soap - 军刀,肥皂。如何使用无会话令牌
问题描述
我想使用无会话令牌来搜索航班,我是通过 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>
请帮忙!
解决方案
OTA_AirAvailLLSRQ 不支持 SessionLess Tokens。此服务需要使用SessionCreate创建的会话令牌。
https://developer.sabre.com/docs/read/soap_apis/air/search/Air_Availability
推荐阅读
- android - 我如何从 firebase 读取到应用程序发明者到各个位置?
- python-3.x - 将 OpenCV 检测到的人脸复制到新图像
- stenciljs - StencilJS:禁用某些组件的自述文件的自动生成
- python - 使用线条在另一个内部创建图形并通过线条链接它们
- vue.js - Nuxt.js/Netlify:在 Netlify 上构建期间未创建 Index.html
- java - 从java中的文件中读取一个单词Assign value
- python - 如果 Python 中的字符串是不可变的,为什么我可以更改函数中的字符串?
- javascript - setState 未在 useEffect 中更新
- ios - 在 iphone11 Pro Max 上运行 pod install 错误启动应用程序时出错
- css - 如何通过 @media 使用内联样式 CSS