T. Rossi
T. Rossi

Reputation: 483

SoapUI first example - Sabre

I am trying to make the first simple soapUI project to work to request a valid session. I am referring to https://developer.sabre.com/docs/read/soap_basics/getting_started Soap UI example.

We have our username, password, IPCC and I generate a ConversationID like suggested in the pdf. I leave "DEFAULT" for Domain.

No matter the endpoint that I set (develpment, cert, prod) I always get bad auth when I try the first "RequestSessionsRQ".

I am probably missing some very basic but I can't figure it out, do you have any suggestion?

UPDATE:

this is the SOAP 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 type="urn:x12.org:IO5:01">WS_Client</eb:PartyId>
         </eb:From>
         <eb:To>
            <eb:PartyId type="urn:x12.org:IO5:01">WS_Provider</eb:PartyId>
         </eb:To>
         <eb:CPAId>${#Project#Organization}</eb:CPAId>
             <eb:ConversationId>${#Project#ConversationID}_${=System.currentTimeMillis()}    </eb:ConversationId>
         <eb:Service eb:type="OTA">SessionCreateRQ</eb:Service>
         <eb:Action>SessionCreateRQ</eb:Action>
         <eb:MessageData>
            <eb:MessageId>Waynaut_id_${=System.currentTimeMillis()}</eb:MessageId>
            <eb:Timestamp>${=import java.text.SimpleDateFormat ; new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ss").format(new Date(System.currentTimeMillis() - 0 * 3600 * 1000))}Z</eb:Timestamp>
            <eb:TimeToLive>${=import java.text.SimpleDateFormat ; new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ss").format(new Date(System.currentTimeMillis() -6 * 3600 * 1000))}Z</eb:TimeToLive>
         </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:UsernameToken>
            <wsse:Username>${#Project#Username}</wsse:Username>
            <wsse:Password>${#Project#Password}</wsse:Password>
            <Organization>${#Project#Organization}</Organization>
            <Domain>DEFAULT</Domain>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <SessionCreateRQ>
         <POS>
            <Source PseudoCityCode="${#Project#Organization}"/>
         </POS>
      </SessionCreateRQ>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

where tokens like ${#Project#Organization} are substituted with our credentials.

and these are the endpoints I've tried: - https://sws3-sts.cert.sabre.com/ - https://sws3-crt.cert.sabre.com/ - https://webservices3.sabre.com/

I have no idea what "PartyId" should be and left the default values given in the documentation example.

These are the response:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
   <soap-env:Header>
      <eb:MessageHeader eb:version="1.0" soap-env:mustUnderstand="1" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader">
         <eb:From>
            <eb:PartyId eb:type="URI">WS_Provider</eb:PartyId>
         </eb:From>
         <eb:To>
            <eb:PartyId eb:type="URI">WS_Client</eb:PartyId>
         </eb:To>
         <eb:CPAId>P4FF</eb:CPAId>
         <eb:ConversationId>TEST-CONVERSATION_1436438834114</eb:ConversationId>
         <eb:Service eb:type="OTA">SessionCreateRQ</eb:Service>
         <eb:Action>ErrorRS</eb:Action>
         <eb:MessageData>
            <eb:MessageId>472e975f-6a9b-4735-980e-c5ea4b4ae8e5@61</eb:MessageId>
            <eb:Timestamp>2015-07-09T10:47:12</eb:Timestamp>
            <eb:RefToMessageId>Waynaut_id_1436438834114</eb:RefToMessageId>
         </eb:MessageData>
      </eb:MessageHeader>
      <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"/>
   </soap-env:Header>
   <soap-env:Body>
      <soap-env:Fault>
         <faultcode>soap-env:Client.AuthenticationFailed</faultcode>
         <faultstring>Authentication failed</faultstring>
         <detail>
            <StackTrace>com.sabre.universalservices.base.security.AuthenticationException: errors.authentication.USG_AUTHENTICATION_FAILED</StackTrace>
         </detail>
      </soap-env:Fault>
   </soap-env:Body>
</soap-env:Envelope>

Upvotes: 2

Views: 2614

Answers (6)

fcarreno
fcarreno

Reputation: 701

It might be late now, but just in case - I tried your exact same request, and it worked for me (with my own credentials).

It is possible that your credentials are locked (e.g.: due to consecutive failed attempts to get a session), so you can contact [email protected] to validate your credentials status.

Make sure to provide the Username and IPCC (Organization) in your communication.

Upvotes: 2

Borgy Manotoy
Borgy Manotoy

Reputation: 2038

SEI: https://webservices.sabre.com

   <soapenv:Header>

      <sec:Security>
         <sec:UsernameToken>
            <sec:Username>${Properties#erp_username}</sec:Username>
            <sec:Password>${Properties#pass_code}</sec:Password>
            <sec:NewPassword>${Properties#pass_code}</sec:NewPassword>
            <Organization>${Properties#ipcc}</Organization>
            <Domain>${Properties#domain}</Domain>
         </sec:UsernameToken>
         <!--Optional:-->
         <sec:SabreAth />
         <sec:BinarySecurityToken />
      </sec:Security>

      <mes:MessageHeader mes:id="1" mes:version="2.0">
         <mes:From>
            <mes:PartyId mes:type="urn:x12.org:IO5:01">${Properties#from_patryid}</mes:PartyId>
            <mes:Role />
         </mes:From>
         <mes:To>
            <mes:PartyId mes:type="urn:x12.org:IO5:01">${Properties#to_patryid}</mes:PartyId>
            <mes:Role />
         </mes:To>
         <mes:CPAId>IPCC</mes:CPAId>
          <mes:ConversationId>${Properties#ConversationID}_${=System.currentTimeMillis()}</mes:ConversationId>
         <mes:Service mes:type="sabreXML">Session</mes:Service>
         <mes:Action>SessionCreateRQ</mes:Action>
         <mes:MessageData>
            <mes:MessageId>bilat_msg_id_${=System.currentTimeMillis()}</mes:MessageId>
            <mes:Timestamp>${=import java.text.SimpleDateFormat ; new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ss").format(new Date(System.currentTimeMillis() - 0 * 3600 * 1000))}Z</mes:Timestamp>
            <mes:RefToMessageId />
            <mes:TimeToLive>${=import java.text.SimpleDateFormat ; new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ss").format(new Date(System.currentTimeMillis() - 0 * 3600 * 1000))}Z</mes:TimeToLive>
            <mes:Timeout>100</mes:Timeout>
         </mes:MessageData>
         <!--Optional:-->
         <mes:DuplicateElimination />
      </mes:MessageHeader>
   </soapenv:Header>

   <soapenv:Body>
      <ns:SessionCreateRQ returnContextID="true">
         <ns:POS>
            <ns:Source PseudoCityCode="${Properties#ipcc}"/>
         </ns:POS>
      </ns:SessionCreateRQ>
   </soapenv:Body>

</soapenv:Envelope>

Upvotes: 0

Lalo
Lalo

Reputation: 1

Here you can see a very easy example.

<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" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
    <SOAP-ENV:Header>
        <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
            <eb:From>
                <eb:PartyId type="urn:x12.org:IO5:01">999999</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId type="urn:x12.org:IO5:01">123123</eb:PartyId>
            </eb:To>
            <eb:CPAId>AM</eb:CPAId> <!-- Set the Airline code , two characters -->
            <eb:ConversationId>WaiversIT</eb:ConversationId>
            <eb:Service>SessionCreateRQ</eb:Service>
            <eb:Action>SessionCreateRQ</eb:Action>
            <eb:MessageData>
                <eb:MessageId>1000</eb:MessageId>               
            </eb:MessageData>
        </eb:MessageHeader>
        <wsse:Security>
            <wsse:UsernameToken>
                <wsse:Username>11111</wsse:Username>
                <wsse:Password>Password</wsse:Password>
                <Organization>AM</Organization><!-- Set the Airline code , two characters -->
                <Domain>AM</Domain><!-- Set the Airline code , two characters -->
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <eb:Manifest SOAP-ENV:mustUnderstand="1" eb:version="1.0">
            <eb:Reference xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="cid:rootelement" xlink:type="simple"/>
        </eb:Manifest>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Upvotes: 0

fizmhd
fizmhd

Reputation: 536

Here is a sample xml for session create that i Use. This works very well.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns="http://www.opentravel.org/OTA/2002/11">
   <soapenv:Header>
      <sec:Security>
         <sec:UsernameToken>
            <sec:Username>Username</sec:Username>
            <sec:Password>Password Here</sec:Password>
            <Organization>xxxxx</Organization>
            <Domain>Default</Domain>
         </sec:UsernameToken>
         <sec:BinarySecurityToken></sec:BinarySecurityToken>
      </sec:Security>
      <mes:MessageHeader mes:id="" mes:version="">
         <mes:From>
            <mes:PartyId mes:type="urn:x12.org.IO5:01">com.abacus.SWSSession</mes:PartyId>
            <mes:Role></mes:Role>
         </mes:From>
         <mes:To>
            <mes:PartyId mes:type="urn:x12.org.IO5:01">webservices.sabre.com</mes:PartyId>
            <mes:Role></mes:Role>
         </mes:To>
         <mes:CPAId>xxxxx</mes:CPAId>
         <mes:ConversationId>[email protected]</mes:ConversationId>
         <mes:Service mes:type="Sabre xml">SessionCreateRQ</mes:Service>
         <mes:Action>SessionCreateRQ</mes:Action>
         <mes:MessageData>
            <mes:MessageId>[email protected]</mes:MessageId>
            <mes:Timestamp>2015-03-19T16:42:11</mes:Timestamp>
            <mes:TimeToLive>#3/20/2015 12:42:11 AM#</mes:TimeToLive>
            <mes:Timeout>30000</mes:Timeout>
         </mes:MessageData>
         <mes:DuplicateElimination></mes:DuplicateElimination>
         <mes:Description xml:lang=""></mes:Description>
      </mes:MessageHeader>
   </soapenv:Header>
   <soapenv:Body>
      <ns:SessionCreateRQ returnContextID="">
         <ns:POS>
            <ns:Source PseudoCityCode="xxxxx"/>
         </ns:POS>
      </ns:SessionCreateRQ>
   </soapenv:Body>
</soapenv:Envelope>

xxxxx - Represents your IPCC code.

My party id remains same for all requests. and this works well on my cert and prod endpoints.

also it is possible that your username and password is not given access by sabre, please contact them and verify the logins are active.

Upvotes: 0

Pj-
Pj-

Reputation: 174

Try 'SessionCreate' for the service name rather than 'SessionCreateRQ'

Here's an example:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
            <From>
                <PartyId>WebServiceClient</PartyId>
            </From>
            <To>
                <PartyId>WebServiceSupplier</PartyId>
            </To>
            <CPAId>{ipcc}</CPAId>
            <ConversationId>657ADE1A-907C-49F9-9F87-94022CD9C51C</ConversationId>
            <Service>SessionCreate</Service>
            <Action>SessionCreateRQ</Action>
            <MessageData>
                <MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
                <Timestamp>2015-07-07T16:57:06Z</Timestamp>
            </MessageData>
        </MessageHeader>
        <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <UsernameToken>
                <Username>{usr}</Username>
                <Password>{pwd}</Password>
                <Organization xmlns="">{ipcc}</Organization>
                <Domain xmlns="">DEFAULT</Domain>
            </UsernameToken>
        </Security>
    </soap:Header>
    <soap:Body>
        <SessionCreateRQ xmlns="http://www.opentravel.org/OTA/2002/11">
            <POS>
                <Source PseudoCityCode="{ipcc}" />
            </POS>
        </SessionCreateRQ>
    </soap:Body>
</soap:Envelope>

I'm hitting https://sws-crt.cert.sabre.com

Upvotes: 1

jmacagno
jmacagno

Reputation: 517

Try AA for domain if you are a Sabre Travel Network customer.

Upvotes: 0

Related Questions