hello everybody!

    I must automate a procedure of files exchange  with a server SOAP but I 
have any idea of how that functions.
  In fact I received the instruction to execute a function which is on SOAP 
server.
  I have got the equivalent of the code in PHP (see below), I would like to 
make the same thing but in coldfusion,

 thank you in advance for your assistance! 

sam
************************************************************
there are the instructions I receive:

To test I've to execute the function GetPinCLIInfo

The input is an array as follows
MSISDN=>'44484238701'
username=>'test'
password=>'testpass'

Here is an example of the actual XML sent and the response.

SEND:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>
<ns9342:GetPinCLIInfo xmlns:ns9342="http://tempuri.org";>
<MSISDN xsi:type="xsd:string">44484238701</MSISDN>
<username xsi:type="xsd:string">test</username>
<password xsi:type="xsd:string">testpass</password>
</ns9342:GetPinCLIInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

RESPONSE:

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="urn:LoCoIN">
<SOAP-ENV:Body>
<ns1:GetPinCLIInfoResponse xmlns:ns1="http://tempuri.org";>
<PINarray xsi:type="tns:GetPinCLIInfoResponse">
<MSISDN xsi:type="xsd:string">44484238701</MSISDN>
<UsedPinOrClip xsi:type="xsd:string">44484238701</UsedPinOrClip>
<IsValidMSISDN xsi:type="xsd:integer">1</IsValidMSISDN>
<StatusDescription xsi:type="xsd:string">Active</StatusDescription>
<CreditsLeftCents xsi:type="xsd:integer">1400</CreditsLeftCents>
<LanguageID xsi:type="xsd:integer">1</LanguageID>
<MNPBeepActivated xsi:type="xsd:integer">0</MNPBeepActivated>
<CurrencyDescription xsi:type="xsd:string">Euro</CurrencyDescription>
<ExpirationDate xsi:type="xsd:string">20070904</ExpirationDate>
</PINarray>
</ns1:GetPinCLIInfoResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

************************************************************
this is PHP code
************************************************************
<?php
// Pull in the NuSOAP code
//phpinfo();
require_once('nusoap.php');

$client = new soapclient('https://soap.THesocity.com/page.php');


// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method

//$result =
$client->call('GetPinCLIInfo',array('MSISDN'=>'44474338100','username'=>'test','password'=>'testpass'));
//$result =
$client->call('GetPinCLIInfo',array('MSISDN'=>'44477307619','username'=>'test','password'=>'testpass'));
$result =
$client->call('GetPinCLIInfo',array('MSISDN'=>'44484238701','username'=>'test','password'=>'testpass'));

//$result =
$client->call('AddCreditsCents',array('MSISDN'=>'44477307619','creditcents'=>100,'username'=>'test','password'=>'testpass'));
//$result =
$client->call('AddCreditsCents',array('MSISDN'=>'44484238701','creditcents'=>-100,'username'=>'test','password'=>'testpass'));


// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        // Display the result
        echo '<h2>Result</h2><pre>';
                print_r($result);
    echo '</pre>';
    }
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) .
'</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) .
'</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) .
'</pre>';

?>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251992
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to