5

我需要你的帮助

我必须使用 Web 服务 SOAP 中的 PHP 函数请求 XML 如下

<OTA_HotelDescriptiveInfoRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="1">
   <POS>
      <Source AgentSine="user" AgentDutyCode="pass" />
   </POS>
   <HotelDescriptiveInfos>
      <HotelDescriptiveInfo ChainCode="H4U" HotelCode="696"/>
   </HotelDescriptiveInfos>
</OTA_HotelDescriptiveInfoRQ>

这是我的PHP代码:

$soapClient = new SoapClient("http://otatest.apixml.com/dispatcher.asmx?WSDL");
$header = new SOAPHeader('http://xmlota.wspan.com/webservice/', 'authentication', array('username' => 'user', 'password' => 'pass'));
$soapClient->__setSoapHeaders($header);

$param['POS']['Source']['AgentSine'] = 'user';
$param['POS']['Source']['AgentDutyCode'] = 'pass';
$param['HotelDescriptiveInfos']['HotelDescriptiveInfo']['ChainCode'] = 'H4U';
$param['HotelDescriptiveInfos']['HotelDescriptiveInfo']['HotelCode'] = '696';

$response = $soapClient->sendOTAHotelDescriptiveInfo($param);

这是我尝试了几天但无法解决的错误

致命错误:未捕获的 SoapFault 异常:[soap:Server] System.Web.Services.Protocols.SoapException:服务器无法处理请求。
---> System.NullReferenceException:对象引用未设置为对象的实例。在 H4U.Webservices.OTA.SoapDispatcher.sendOTAHotelDescriptiveInfo(OTA_HotelDescriptiveInfoRQ OTA_HotelDescriptiveInfoRQ)
--- 内部异常堆栈跟踪结束 ---
在 /home/dimavoya/public_html/soap/soap.php:43

堆栈跟踪:
#0 /home/dimavoya/public_html/soap/soap.php(43): SoapClient->__call('sendOTAHotelDes...', 数组)
#1 /home/dimavoya/public_html/soap/soap.php(43): SoapClient->sendOTAHotelDescriptiveInfo(Object(SoapVar))
#2 {main} 投入

我随时为您服务以获取更多信息

先感谢您

4

0 回答 0