4

I need your help

I have to use PHP functions from a web service SOAP The request XML is as follows

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

Here is my PHP code:

$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);

And here is the error I'm trying for several days but I can not resolve it

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 

I remain at your disposal for more information

Thank you in advance

doydoy44
  • 5,665
  • 4
  • 26
  • 43
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – tom redfern Jan 11 '17 at 10:31

0 Answers0