Skip to content

Instantly share code, notes, and snippets.

@cnizzardini
Created July 12, 2017 06:56
Show Gist options
  • Save cnizzardini/bd28f64875f11f6184903f64e08f77f6 to your computer and use it in GitHub Desktop.
Save cnizzardini/bd28f64875f11f6184903f64e08f77f6 to your computer and use it in GitHub Desktop.
Sabre SoapClient::__doRequest
<?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');
@zakrian07
Copy link

how to get this response in array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment