Search code examples
phpxmlweb-servicessoapsabre

how can i create a soap in php for SABRE?


I am new to the world of SOAP, I want to know how I can make a request to the saber servers, but I have not succeeded, I need help to make the following request.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Header>
        <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
            <eb:From>
                <eb:PartyId>Client</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId>SWS</eb:PartyId>
            </eb:To>
            <eb:CPAId>3DBJ</eb:CPAId>
            <eb:ConversationId>MyConversationID</eb:ConversationId>
            <eb:Service>Service</eb:Service>
            <eb:Action>getReservationRQ</eb:Action>
            <eb:MessageData>
                <eb:MessageId></eb:MessageId>
                <eb:Timestamp></eb:Timestamp>
            </eb:MessageData>
        </eb:MessageHeader>
        <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
            <wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESE!ICESMSLB\/RES.LB!1</wsse:BinarySecurityToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns7:GetReservationRQ xmlns:ns7="http://webservices.sabre.com/pnrbuilder/v1_15" Version="1.15.0">
            <ns7:Locator>JXJ</ns7:Locator>
            <ns7:RequestType>Stateful</ns7:RequestType>
            <ns7:ReturnOptions UnmaskCreditCard="true">
                <ns7:SubjectAreas>
                    <ns7:SubjectArea>PRICING_INFORMATION</ns7:SubjectArea>
                </ns7:SubjectAreas>
            </ns7:ReturnOptions>
        </ns7:GetReservationRQ>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is my XML that I sent in postman and it generates a result but when I do it in PHP it generates an error.

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webservices.havail.sabre.com' : Document is empty





$client  = new SoapClient("https://webservices.havail.sabre.com");

$checkVatParameters =array( 
'BinarySecurityToken' => 'Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESE!ICESMSLB\/RES.LB!',
'Locator' => 'JXJ',
'RequestType'=>'Stateful',
'SubjectArea'=>'PRICING_INFORMATION'

);//variables

$result=$client->__getFunctions();
$result = $client->GetReservationRQ($checkVatParameters);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n";

}

they only gave me a URL but it asks me WDSL


Solution

  • he solved my problem in this way

        $location_URL = "https://sws-crt.cert.havail.sabre.com";
        $action_URL = "http://webservices.sabre.com/pnrbuilder/v1_15";
    
        $client = new SoapClient(null, array(
        'location' => $location_URL,
        'uri'      => "",
        'trace'    => 1,
        ));
    
        $order_return = $client->__doRequest($xml,$location_URL,$action_URL,1);