...
Code Block | ||||
---|---|---|---|---|
| ||||
// Define the proper Endpoint. Check the chapters on the endpoints to get the correct one for your usage $endpoint = 'https://staging.hotel-spider.ch/ota/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; $params = array('http' => array( 'method' => 'POST', 'content' => $Request )); $ctx = stream_context_create($params); $fp = @fopen($endpoint , 'rb', false, $ctx); if (!$fp) { throw new Exception("Problem with $endpoint , $php_errormsg"); } $Response = @stream_get_contents($fp); if ($Response === false) { throw new Exception("Problem reading data from $endpoint , $php_errormsg"); } |
2. SOAP
Warning | ||
---|---|---|
| ||
The below example needs to be completed. |
Code Block | ||||
---|---|---|---|---|
| ||||
// 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, ) ); try { return $this->_client->__soapCall("OTA_HotelAvailNotif", array($subscribeRequest), null, $this->_header); } catch (SoapFault $e) { throw new Exception('ERROR in ' . __METHOD__, $e, $this->_client->__getLastRequestHeaders(), $this->_client->__getLastRequest(), $this->_client->__getLastResponseHeaders(), $this->_client->__getLastResponse()); } |