代码之家  ›  专栏  ›  技术社区  ›  Lukas J

Sabre Soap会话令牌在使用前过期

  •  0
  • Lukas J  · 技术社区  · 7 年前

    我使用SessionCreateRQ创建会话令牌,我获得令牌和会话Id。每当我尝试使用相同的详细信息运行BergainFinderMxRQ时,我都会得到一个过期或无效的令牌错误。

    以下是请求和响应

    会话创建器Q

    <?xml version="1.0" encoding="UTF-8"?>
    <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 xmlns="http://www.ebxml.org/namespaces/messageHeader">
             <eb:From>
                <eb:PartyId type="urn:x12.org:IO5:01">http://localhost:8000</eb:PartyId>
             </eb:From>
             <eb:To>
                <eb:PartyId type="urn:x12.org:IO5:01">https://webservices.havail.sabre.com</eb:PartyId>
             </eb:To>
             <eb:CPAId>****</eb:CPAId>
             <eb:ConversationId>V1@xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@5a9664b7bdd73@http://localhost:8000</eb:ConversationId>
             <eb:Service eb:type="sting">Cruise</eb:Service>
             <eb:Action>SessionCreateRQ</eb:Action>
             <eb:MessageData>
                <MessageId>xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@http://localhost:8000</MessageId>
                <Timestamp>2018-02-28T08:13:43+01:00</Timestamp>
                <TimeToLive>2018-02-28T09:13:43+01:00</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>****</wsse:Username>
                <wsse:Password>******</wsse:Password>
                <Organization>****/Organization>
                <Domain>DEFAULT</Domain>
             </wsse:UsernameToken>
          </wsse:Security>
       </SOAP-ENV:Header>
       <SOAP-ENV:Body>
          <SessionCreateRQ xmlns="http://www.opentravel.org/OTA/2002/11">
             <POS>
                <Source PseudoCityCode="****" />
             </POS>
          </SessionCreateRQ>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    会话创建者

    <?xml version="1.0" encoding="UTF-8"?>
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
       <soap-env:Header>
          <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
             <eb:From>
                <eb:PartyId eb:type="URI">https://webservices.havail.sabre.com</eb:PartyId>
             </eb:From>
             <eb:To>
                <eb:PartyId eb:type="URI">http://localhost:8000</eb:PartyId>
             </eb:To>
             <eb:CPAId>****</eb:CPAId>
             <eb:ConversationId>V1@xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@5a9664b7bdd73@http://localhost:8000</eb:ConversationId>
             <eb:Service eb:type="sabreXML">Session</eb:Service>
             <eb:Action>SessionCreateRS</eb:Action>
             <eb:MessageData>
                <eb:MessageId>3230747296278060193</eb:MessageId>
                <eb:Timestamp>2018-02-28T08:13:48</eb:Timestamp>
                <eb:RefToMessageId>xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@http://localhost:8000</eb:RefToMessageId>
             </eb:MessageData>
          </eb:MessageHeader>
          <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
             <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESD!ICESMSLB\/RES.LB!-3173602095678878075!1805403!0</wsse:BinarySecurityToken>
          </wsse:Security>
       </soap-env:Header>
       <soap-env:Body>
          <SessionCreateRS xmlns="http://www.opentravel.org/OTA/2002/11" version="1" status="Approved">
             <ConversationId>V1@xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@5a9664b7bdd73@http://localhost:8000</ConversationId>
          </SessionCreateRS>
       </soap-env:Body>
    </soap-env:Envelope>
    

    然后我前往BargainFinderMaxRQ

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Header>
          <m:MessageHeader xmlns:m="http://www.ebxml.org/namespaces/messageHeader">
             <m:From>
                <m:PartyId type="urn:x12.org:IO5:01">http://localhost:8000</m:PartyId>
             </m:From>
             <m:To>
                <m:PartyId type="urn:x12.org:IO5:01">https://webservices.havail.sabre.com</m:PartyId>
             </m:To>
             <m:CPAId>***</m:CPAId>
             <m:ConversationId>V1@xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@5a9664b7bdd73@http://localhost:8000</m:ConversationId>
             <m:Service m:type="OTA">BargainFinderMaxRQ</m:Service>
             <m:Action>BargainFinderMaxRQ</m:Action>
             <m:MessageData>
                <m:MessageId>3230747296278060193</m:MessageId>
                <m:Timestamp>2018-02-28T08:15:25Z</m:Timestamp>
                <m:TimeToLive>2018-02-28T08:15:25Z</m:TimeToLive>
             </m:MessageData>
             <m:DuplicateElimination />
             <m:Description>BargainFinderMaxRQ</m:Description>
          </m:MessageHeader>
          <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
             <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESD!ICESMSLB\/RES.LB!-3173602095678878075!1805403!0</wsse:BinarySecurityToken>
          </wsse:Security>
       </SOAP-ENV:Header>
       <SOAP-ENV:Body>
          <OTA_AirLowFareSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xs="http://www.w3.org/2001/XMLSchema" Target="Production" Version="3.3.0" ResponseType="OTA" ResponseVersion="3.3.0">
             <POS>
                <Source PseudoCityCode="****">
                   <RequestorID ID="1" Type="1">
                      <CompanyName Code="TN" />
                   </RequestorID>
                </Source>
             </POS>
             <OriginDestinationInformation RPH="1">
                <DepartureDateTime>2018-03-04T00:00:00</DepartureDateTime>
                <OriginLocation LocationCode="LHR" />
                <DestinationLocation LocationCode="DXB" />
                <TPA_Extensions>
                   <SegmentType Code="O" />
                </TPA_Extensions>
             </OriginDestinationInformation>
             <OriginDestinationInformation RPH="2">
                <DepartureDateTime>2018-03-07T00:00:00</DepartureDateTime>
                <OriginLocation LocationCode="DXB" />
                <DestinationLocation LocationCode="LHR" />
                <TPA_Extensions>
                   <SegmentType Code="O" />
                </TPA_Extensions>
             </OriginDestinationInformation>
             <TravelPreferences ValidInterlineTicket="true">
                <CabinPref PreferLevel="Preferred" Cabin="Y" />
                <TPA_Extensions>
                   <TripType Value="Return" />
                   <LongConnectTime Min="780" Max="1200" Enable="true" />
                   <ExcludeCallDirectCarriers Enabled="true" />
                </TPA_Extensions>
             </TravelPreferences>
             <TravelerInfoSummary>
                <SeatsRequested>1</SeatsRequested>
                <AirTravelerAvail>
                   <PassengerTypeQuantity Code="ADT" Quantity="1" />
                </AirTravelerAvail>
             </TravelerInfoSummary>
             <TPA_Extensions>
                <IntelliSellTransaction>
                   <RequestType Name="100ITINS" />
                </IntelliSellTransaction>
             </TPA_Extensions>
          </OTA_AirLowFareSearchRQ>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    然后我得到BargainFinderMaxRS的回复

    <?xml version="1.0" encoding="UTF-8"?>
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
       <soap-env:Header>
          <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
             <eb:From>
                <eb:PartyId eb:type="URI">https://webservices.havail.sabre.com</eb:PartyId>
             </eb:From>
             <eb:To>
                <eb:PartyId eb:type="URI">http://localhost:8000</eb:PartyId>
             </eb:To>
             <eb:CPAId>****</eb:CPAId>
             <eb:ConversationId>V1@xvRh8eAWk1tS4aSk7EB9y0ylxZ7g3Mpttgv5h3NL@5a9664b7bdd73@http://localhost:8000</eb:ConversationId>
             <eb:Service eb:type="OTA">BargainFinderMaxRQ</eb:Service>
             <eb:Action>ErrorRS</eb:Action>
             <eb:MessageData>
                <eb:MessageId>1050662297266000611</eb:MessageId>
                <eb:Timestamp>2018-02-28T08:15:27</eb:Timestamp>
                <eb:RefToMessageId>3230747296278060193</eb:RefToMessageId>
             </eb:MessageData>
          </eb:MessageHeader>
          <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
             <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESD!ICESMSLB\/RES.LB!-3173602095678878075!1805403!0</wsse:BinarySecurityToken>
          </wsse:Security>
       </soap-env:Header>
       <soap-env:Body>
          <soap-env:Fault>
             <faultcode>soap-env:Client.InvalidSecurityToken</faultcode>
             <faultstring>Invalid or Expired binary security token: Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESD!ICESMSLB\/RES.LB!-3173602095678878075!1805403!0</faultstring>
             <detail>
                <StackTrace>com.sabre.universalservices.base.session.SessionException: errors.session.USG_INVALID_SECURITY_TOKEN</StackTrace>
             </detail>
          </soap-env:Fault>
       </soap-env:Body>
    </soap-env:Envelope>
    

    P: S。。我在向发送请求时使用了相同的过程 https://sws-crt.cert.havail.sabre.com . 问题是在我切换到 https://webservices.havail.com .

    ****出于安全原因被我删除

    请问我在请求中有什么地方做错了吗

    1 回复  |  直到 7 年前
        1
  •  0
  •   Bruno    7 年前

    问题很可能是您现在正在PROD环境中创建会话( https://webservices.havail.com )但您仍在向CERT环境发送BFM( https://sws-crt.cert.havail.sabre.com ). 确保将两个请求发送到同一个端点。