Saber肥皂会话令牌在使用前到期

时间:2018-02-28 09:47:16

标签: php session soap sabre

我使用SessionCreateRQ创建会话令牌,我获得令牌和会话ID。每当我尝试使用相同的细节运行BergainFinderMxRQ时,我会收到过期或无效的令牌错误。

以下是请求和回复

SessionCreateRQ

<?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>

SessionCreateRS

<?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 个答案:

答案 0 :(得分:0)

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