title: PHP SOAP : Object reference not set to an instance of an object
body: <p>I need your help</p>
  
  <p>I have to use PHP functions from a web service SOAP
  The request XML is as follows</p>
  
  <pre><code>&lt;OTA_HotelDescriptiveInfoRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="1"&gt;
     &lt;POS&gt;
        &lt;Source AgentSine="user" AgentDutyCode="pass" /&gt;
     &lt;/POS&gt;
     &lt;HotelDescriptiveInfos&gt;
        &lt;HotelDescriptiveInfo ChainCode="H4U" HotelCode="696"/&gt;
     &lt;/HotelDescriptiveInfos&gt;
  &lt;/OTA_HotelDescriptiveInfoRQ&gt;
  </code></pre>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>$soapClient = new SoapClient("http://otatest.apixml.com/dispatcher.asmx?WSDL");
  $header = new SOAPHeader('http://xmlota.wspan.com/webservice/', 'authentication', array('username' =&gt; 'user', 'password' =&gt; 'pass'));
  $soapClient-&gt;__setSoapHeaders($header);
  
  $param['POS']['Source']['AgentSine'] = 'user';
  $param['POS']['Source']['AgentDutyCode'] = 'pass';
  $param['HotelDescriptiveInfos']['HotelDescriptiveInfo']['ChainCode'] = 'H4U';
  $param['HotelDescriptiveInfos']['HotelDescriptiveInfo']['HotelCode'] = '696';
  
  $response = $soapClient-&gt;sendOTAHotelDescriptiveInfo($param);
  </code></pre>
  
  <p>And here is the error I'm trying for several days but I can not resolve it</p>
  
  <pre>
  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 
  </pre>
  
  <p>I remain at your disposal for more information</p>
  
  <p>Thank you in advance</p>