我正在创建肥皂请求,以寻求空气可用的saber api。我正在使用API文档中的肥皂参数。首先,我要求获得会话令牌,然后成功获得一个,但是当我触发API请求时,我会遇到服务错误。说我正在使用无效的服务或版本及其500错误。我已经检查了所有不确定下一步该怎么做的事情。请帮助。
Saber API链接:https://developer.sabre.com/docs/read/soap_apis/air/search/air_availability这是Postman的请求片段:
<?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 SOAP-ENV:mustUnderstand="1" eb:version="2.0">
<eb:ConversationId>rajdeepa555@gmail.com</eb:ConversationId>
<eb:From>
<eb:PartyId type="urn:x12.org:IO5:01">WebServiceClient</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId type="urn:x12.org:IO5:01">WebServiceSupplier</eb:PartyId>
</eb:To>
<eb:CPAId>F9CE</eb:CPAId>
<eb:Service eb:type="sabreXML">OTA_AirAvailLLSRQ</eb:Service>
<eb:Action>OTA_AirAvailLLSRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>mid:20031209-133003-2334@clientURL</eb:MessageId>
<eb:Timestamp>2017-06-20T11:15:14Z</eb:Timestamp>
<eb:Timeout>50</eb:Timeout>
</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/ACPCRTD!ICESMSLB/CRT.LB!-3261887980644185979!896467!0
</wsse:BinarySecurityToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<eb:Manifest SOAP-ENV:mustUnderstand="1" eb:version="2.0">
<eb:Reference xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="cid:OTA_AirAvailRQ" xlink:type="simple"/>
</eb:Manifest>
<POS>
<Source PseudoCityCode="F9CE"/>
</POS>
<OTA_AirAvailRQ Version="2.4.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="LHR" />
<OriginLocation LocationCode="DFW" />
</FlightSegment>
</OriginDestinationInformation>
</OTA_AirAvailRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
确保身体仅包括ota_airavailllsrq有效载荷,您将获得成功的响应。
<SOAP-ENV:Body>
<OTA_AirAvailRQ Version="2.4.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="LHR" />
<OriginLocation LocationCode="DFW" />
</FlightSegment>
</OriginDestinationInformation>
</OTA_AirAvailRQ>
</SOAP-ENV:Body>
与brunos注释相关,以下要求效果很好:
<?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">from</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:x12.org:IO5:01">ws</eb:PartyId>
</eb:To>
<eb:CPAId>YOURPCC</eb:CPAId>
<eb:ConversationId>YourConversationId</eb:ConversationId>
<eb:Service eb:type="sabreXML"></eb:Service>
<eb:Action>OTA_AirAvailLLSRQ</eb:Action>
</eb:MessageHeader>
<eb:Security xmlns:eb="http://schemas.xmlsoap.org/ws/2002/12/secext" SOAP-ENV:mustUnderstand="0">
<eb:BinarySecurityToken>YOUR SESSION TOKEN</eb:BinarySecurityToken>
</eb:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<OTA_AirAvailRQ Version="2.4.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="LHR" />
<OriginLocation LocationCode="DFW" />
</FlightSegment>
</OriginDestinationInformation>
</OTA_AirAvailRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>