首页 > 解决方案 > 军刀,肥皂。如何使用无会话令牌

问题描述

我想使用无会话令牌来搜索航班,我是通过 TokenCreateRQ API 创建的令牌,但是在搜索航班时,响应返回错误。如何使用无会话令牌与 Sabre 服务器调用 API?

这是带有会话令牌的请求:

    <?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 xmlns='http://webservices.sabre.com/sabreXML/2011/10'>
            <eb:MessageHeader eb:version='1.0' 
                xmlns:eb='http://www.ebxml.org/namespaces/messageHeader' 
                xmlns='http://webservices.sabre.com/sabreXML/2011/10' SOAP-ENV:mustUnderstand='1'>
                <eb:From>
                    <eb:PartyId eb:type='urn:x12.org:IO5:01'>webservices.sabre.com</eb:PartyId>
                </eb:From>
                <eb:To>
                    <eb:PartyId eb:type='urn:x12.org:IO5:01'>20001od.arilines@info.com</eb:PartyId>
                </eb:To>
                <eb:CPAId>OD</eb:CPAId>
                <eb:ConversationId>20001-OD-1</eb:ConversationId>
                <eb:Service eb:type='sabreXML'>OTA_AirAvailLLSRQ</eb:Service>
                <eb:Action>OTA_AirAvailLLSRQ</eb:Action>
                <eb:MessageData>
                    <eb:MessageId>477074285960250152</eb:MessageId>
                    <eb:Timestamp>2019-01-14T08:15:07</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 valueType='String' EncodingType='wsse:Base64Binary'>T1RLAQK/kiOCnpnAl9UVbA+ec/6W28TsohCsdMPUn8cmmeo2PsY8w8OEAACgmiUlMWHJafsc5R6u8wjlUqwk1VX/lmzTgqtr+DWSlwmEsomADWrnscwbk2QxUQDeN/2RqnG77DtzF4O6bZkY4HO990SyrO5SngyQEd0OQGDUTbfEL4SmsK0mKQCdemN5Gb4UWcA0cIYBKXIGsBuMLkJ3+REWUejyeBuCUiIvSljmjhLcJPWgJJlqRNv2Mqo+1q/KTpbstX48UJi71Kug7w**</wsse:BinarySecurityToken>
            </wsse:Security>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <OTA_AirAvailRQ 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' ReturnHostCommand='false' Version='2.0.0'>
                <OptionalQualifiers xmlns='http://webservices.sabre.com/sabreXML/2011/10'>
                    <FlightQualifiers>
                        <VendorPrefs>
                            <Airline Code='OD'/>
                        </VendorPrefs>
                    </FlightQualifiers>
                </OptionalQualifiers>
                <OriginDestinationInformation>
                    <FlightSegment DepartureDateTime='01-23'>
                        <DestinationLocation LocationCode='SIN'/>
                        <OriginLocation LocationCode='HAN'/>
                    </FlightSegment>
                </OriginDestinationInformation>
            </OTA_AirAvailRQ>
        </SOAP-ENV:Body> </SOAP-ENV:Envelope>

这是响应返回:

    <soap-env:Body>
        <OTA_AirAvailRS 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" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.0.0">
            <stl:ApplicationResults status="NotProcessed">
                <stl:Error type="Application" timeStamp="2019-01-14T22:16:07-06:00">
                    <stl:SystemSpecificResults>
                        <stl:Message>Unexpected request processing error</stl:Message>
                        <stl:ShortText>ERR.SWS.PROVIDER.REQUEST_HANDLER_ERROR</stl:ShortText>
                    </stl:SystemSpecificResults>
                </stl:Error>
            </stl:ApplicationResults>
        </OTA_AirAvailRS>
    </soap-env:Body>

请帮忙!

标签: soapsabre

解决方案


OTA_AirAvailLLSRQ 不支持 SessionLess Tokens。此服务需要使用SessionCreate创建的会话令牌。

https://developer.sabre.com/docs/read/soap_apis/air/search/Air_Availability


推荐阅读