duandun3178 2016-01-24 09:42
浏览 42

无效或过期的二进制安全性令牌:null

Why session is expired immediately after getting the response from the Authentication request?

I get the binary token as described here https://developer.sabre.com/docs/read/soap_basics/Authentication . After getting token from there , I am using the same token to search the flight but I get error like : `

com.sabre.universalservices.base.security.AuthenticationException: errors.session.USG_INVALID_SECURITY_TOKEN

`

My code to search the flight is :

$wsdl = "http://webservices.sabre.com/wsdl/tpfc/OTA_AirAvailLLS2.3.0RQ.wsdl";
$sabreSoapServer = "https://webservices3.sabre.com";

$xml='<?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" SOAP-ENV:mustUnderstand="0">
                <eb:From>
                    <eb:PartyId eb:type="urn:x12.org:IO5:01">localhost/sabre</eb:PartyId>
                </eb:From>
                <eb:To>
                    <eb:PartyId eb:type="urn:x12.org:IO5:01">sabre</eb:PartyId>
                </eb:To>
                <eb:CPAId>3W2D</eb:CPAId>
                <eb:ConversationId>testingId</eb:ConversationId>
                <eb:Service eb:type="sabreXML">"OTA_AirAvailService</eb:Service>
                <eb:Action>OTA_AirAvailLLSRQ</eb:Action>
                <eb:MessageData>
                    <eb:MessageId>1426190858</eb:MessageId>
                     <eb:Timestamp>2016-01-24T03:21:00+05:45</eb:Timestamp>
                    <eb:TimeToLive>2016-01-24T04:21:00+05:45</eb:TimeToLive>
               </eb:MessageData>

               <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">

                  <wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESB!ICESMSLB\/RES.LB!-3444664992093836124!1921249!0</wsse:BinarySecurityToken>

                </wsse:Security>


            </eb:MessageHeader> 
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <OTA_AirAvailRQ Version="2.2.0" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
              <OriginDestinationInformation> 
                  <FlightSegment DepartureDateTime="12-21"> 
                      <DestinationLocation LocationCode="DFW"/> 
                      <OriginLocation LocationCode="HNL"/> 
                  </FlightSegment> 
              </OriginDestinationInformation> 
          </OTA_AirAvailRQ> 
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>';


   $client = new SoapClient($wsdl);
   $response = $client->__doRequest($xml,$sabreSoapServer,$sabreSoapServer,'1');  
   $xml = simplexml_load_string($response , NULL , NULL , "http://schemas.xmlsoap.org/soap/envelope/");
   print_r($xml);

Response :

<?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="urn:x12.org:IO5:01">sabre</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId eb:type="urn:x12.org:IO5:01">localhost/sabre</eb:PartyId>
            </eb:To>
            <eb:CPAId>3W2D</eb:CPAId>
            <eb:ConversationId>testingId</eb:ConversationId>
            <eb:Service eb:type="sabreXML">"OTA_AirAvailService</eb:Service>
            <eb:Action>ErrorRS</eb:Action>
            <eb:MessageData>
                <eb:MessageId>506560ad-1ab6-4dfb-9b54-f26cef3e6658@20</eb:MessageId>
                <eb:Timestamp>2016-01-24T09:28:54</eb:Timestamp>
                <eb:RefToMessageId>1426190858</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.InvalidSecurityToken</faultcode>
            <faultstring>Invalid or Expired binary security token: null</faultstring>
            <detail>
                <StackTrace>com.sabre.universalservices.base.security.AuthenticationException: errors.session.USG_INVALID_SECURITY_TOKEN</StackTrace>
            </detail>
        </soap-env:Fault>
    </soap-env:Body>
</soap-env:Envelope>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥15 帮我写一个c++工程