M
M
MOst_532010-11-19 12:10:00
PHP
MOst_53, 2010-11-19 12:10:00

Using nusoap.php instead of soap-extention?

In general, there was such a code (which plowed perfectly on a local server):

$client = new SoapClient(&quot;https://llu.webservices.opalonline.co.uk/LineAvailabilityCheckerServiceV1200/InGroup/LineAvailabilityCheckerService.asmx?WSDL&quot;);<br/>
 $params = new stdClass();<br/>
 $params-&gt;Username = 'username';<br/>
 $params-&gt;Password = 'pass';<br/>
 $params-&gt;ResellerID = 6;<br/>
 $params-&gt;consent = 'Yes';<br/>
 $params-&gt;characteristics-&gt;TelephoneNumber = $phone;<br/>
 $params-&gt;characteristics-&gt;AccessLineStatus = 'NotSet';<br/>
 $params-&gt;characteristics-&gt;ExchangeState = 'NotSet';<br/>
 $params-&gt;characteristics-&gt;ExchangeCapacityFlag = 'NotSet';<br/>
 $params-&gt;characteristics-&gt;ForecastDate = '2010-01-01+01:01';<br/>
 $params-&gt;characteristics-&gt;DirectPortabilityFlag = 'NotSet';<br/>
 $params-&gt;characteristics-&gt;CeaseDate = '2010-01-01+01:01';<br/>
 $params-&gt;characteristics-&gt;CeaseType = 'NotSet';<br/>
 $params-&gt;characteristics-&gt;ServiceType = $technology;<br/>
<br/>
$TTAC_result = $client-&gt;GetLineCharacteristicsForTelephoneNumber($params);

But the soap extension is not enabled on the client on the server and it cannot be enabled, so I rewrote the code using the nusoap.php library:
require_once(BASE_PATH . '/libex/soap/nusoap.php');<br/>
 $client = new nusoapclient('https://llu.webservices.opalonline.co.uk/LineAvailabilityCheckerServiceV1200/InGroup/LineAvailabilityCheckerService.asmx?WSDL', true);<br/>
<br/>
$params = array();<br/>
 $params['Username'] = '[email protected]';<br/>
 $params['Password'] = 'username';<br/>
 $params['ResellerID'] = pass;<br/>
 $params['consent'] = 'Yes';<br/>
 $params['characteristics']['TelephoneNumber'] = $phone;<br/>
 $params['characteristics']['AccessLineStatus'] = 'NotSet';<br/>
 $params['characteristics']['ExchangeState'] = 'NotSet';<br/>
 $params['characteristics']['ExchangeCapacityFlag'] = 'NotSet';<br/>
 $params['characteristics']['ForecastDate'] = '2010-01-01+01:01';<br/>
 $params['characteristics']['DirectPortabilityFlag'] = 'NotSet';<br/>
 $params['characteristics']['CeaseDate'] = '2010-01-01+01:01';<br/>
 $params['characteristics']['CeaseType'] = 'NotSet';<br/>
 $params['characteristics']['ServiceType'] = $technology;<br/>
<br/>
$result = $client-&gt;call('GetLineCharacteristicsForTelephoneNumber', $params);<br/>
<br/>
echo '<pre>' . htmlspecialchars($client-&gt;response, ENT_QUOTES) . '</pre>';

the last line returns:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/>
 &lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<br/>
&lt;soap:Body&gt;<br/>
 ServiceErrorMPFNotSet<br/>
NotSet<br/>
NotSet<br/>
0001-01-01T00:00:00<br/>
NotSet<br/>
NotSet<br/>
0001-01-01T00:00:00<br/>
&lt;LastBandwidthCalculationDate xsi:nil=&quot;true&quot; /&gt;<br/>
<br/>
<br/>
&lt;/soap:Body&gt;<br/>
&lt;/soap:Envelope&gt;

and the request looks like this:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;<br/>
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:ns2620=&quot;http://tempuri.org&quot;&gt;<br/>
&lt;SOAP-ENV:Body&gt;<br/>
/&gt;<br/>
&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;

I think that the problem is in passing parameters to the request ($params). Help, plz, until I finally broke my brain.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question