Created
July 12, 2017 06:56
-
-
Save cnizzardini/bd28f64875f11f6184903f64e08f77f6 to your computer and use it in GitHub Desktop.
Sabre SoapClient::__doRequest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sabreSoapServer = ''; // url | |
$pcc = ''; // sabre pcc | |
$username = ''; // sabre username | |
$password = ''; // sabre password | |
$xmlStr = '<?xml version="1.0" encoding="UTF-8"?> | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<soapenv:Header> | |
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader"> | |
<From> | |
<PartyId type="urn:x12.org:IO5:01">CRS</PartyId> | |
</From> | |
<To> | |
<PartyId type="urn:x12.org:IO5:01">Sabre</PartyId> | |
</To> | |
<CPAId>'.$pcc.'</CPAId> | |
<ConversationId>MyConversationID</ConversationId> | |
<Service type="string">Cruise</Service> | |
<Action>SessionCreateRQ</Action> | |
<MessageData> | |
<MessageId>1426190858</MessageId> | |
<Timestamp>2015-03-12T02:07:38-06:00</Timestamp> | |
<TimeToLive>2015-03-12T03:07:38-06:00</TimeToLive> | |
</MessageData> | |
</MessageHeader> | |
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility"> | |
<wsse:UsernameToken> | |
<wsse:Username>'.$username.'</wsse:Username> | |
<wsse:Password>'.$password.'</wsse:Password> | |
<Organization>'.$pcc.'</Organization> | |
<Domain>DEFAULT</Domain> | |
</wsse:UsernameToken> | |
</wsse:Security> | |
</soapenv:Header> | |
<soapenv:Body> | |
<SessionCreateRQ xmlns="http://www.opentravel.org/OTA/2002/11"> | |
<POS> | |
<Source PseudoCityCode="'.$pcc.'" /> | |
</POS> | |
</SessionCreateRQ> | |
</soapenv:Body> | |
</soapenv:Envelope>'; | |
$client = new SoapClient(null, array( | |
'location' => $sabreSoapServer, | |
'uri' => $sabreSoapServer, | |
'trace' => 1, | |
'exceptions' => true, | |
'use' => 'wse' | |
)); | |
$response = $client->__doRequest($xmlStr, $sabreSoapServer, $sabreSoapServer, '1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to get this response in array?