@MOst_53

Использование nusoap.php вместо soap-extention?

В общем был такой код (который отлично пахал на локальном серваке):
$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);



Но у клиента на сервере расширение soap не включено и включить его нельзя и я переписал код с использованием библиотеки nusoap.php:

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'] = 'ttb_provisioning@opaltelecom.co.uk';<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>';



последняя строчка возвращает:
&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;



а запрос выглядит так:

&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;



Я думаю что проблема в передаче параметров запросу($params). Помогите, плз, пока я себе мозг окончательно не сломал.
  • Вопрос задан
  • 3424 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы