PHP SOAP:未将对象引用设置为对象的实例

时间:2012-11-27 09:14:23

标签: php soap

我需要你的帮助

我必须使用来自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);

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

Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. 
---> System.NullReferenceException: Object reference not set to an instance of an object. at H4U.Webservices.OTA.SoapDispatcher.sendOTAHotelDescriptiveInfo(OTA_HotelDescriptiveInfoRQ OTA_HotelDescriptiveInfoRQ) 
--- End of inner exception stack trace --- 
in /home/dimavoya/public_html/soap/soap.php:43 

Stack trace: 
#0 /home/dimavoya/public_html/soap/soap.php(43): SoapClient->__call('sendOTAHotelDes...', Array) 
#1 /home/dimavoya/public_html/soap/soap.php(43): SoapClient->sendOTAHotelDescriptiveInfo(Object(SoapVar)) 
#2 {main} thrown in 

我会随时为您提供更多信息

提前谢谢

0 个答案:

没有答案