Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
titlePHP with SoapClient class
// Define the proper Endpoint. Check the chapters on the endpoints to get the correct one for your usage
$wsdl = 'https://staging.hotel-spider.ch/soap/OTA_HotelAvailNotifRQ/2014A'
$Request = <<< XML
<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelAvailNotifRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelAvailNotifRQ.xsd" TimeStamp="2012-10-05T14:20:50" Target="Test" Version="1.005">
  <POS>
    <Source>
      <RequestorID Type="5" ID="*************" MessagePassword="*************"></RequestorID>
    </Source>
  </POS>
  <AvailStatusMessages>
    <AvailStatusMessage BookingLimit="25" LocatorID="1">
      <StatusApplicationControl Start="2015-09-24" End="2015-09-24" InvTypeCode="*************"/>
    </AvailStatusMessage>
  </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>
XML;

$client = new SoapClient(self::$_config->wsdl,
            array(
                'trace'=>1,
                'classmap' => self::$_classmap,
            )
        $wsdl);

try {
	return $this->_client$client->__soapCall("OTA_HotelAvailNotif", array($subscribeRequest), null, $this->_header);   
} catch (SoapFaultException $e) {
	throw new Exception('ERROR in ' . __METHOD__, $e, $this->_client$client->__getLastRequestHeaders(), $this$client->_client->__getLastRequest(), $this->_client$client->__getLastResponseHeaders(), $this->_client$client->__getLastResponse());
}