使用Sabre SOAP API检索航班信息时出错

时间:2016-01-14 12:52:55

标签: node.js soap sabre

我首先发送一个检索身份验证令牌的请求;使用该令牌,我尝试进行OTA_AirAvailLLSRS调用,返回以下结果:

<?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">123982</eb:PartyId>
         </eb:From>
         <eb:To>
            <eb:PartyId eb:type="urn:x12.org:IO5:01">234552</eb:PartyId>
         </eb:To>
         <eb:CPAId>adf</eb:CPAId>
         <eb:ConversationId>1343843</eb:ConversationId>
         <eb:Service eb:type="OTA">OTA_AirAvailLLSRQ</eb:Service>
         <eb:Action>OTA_AirAvailLLSRS</eb:Action>
         <eb:MessageData>
            <eb:MessageId>6ef80a1d-a960-4ab1-bf52-bab150ef7a16@61</eb:MessageId>
            <eb:Timestamp>2016-01-14T12:37:31</eb:Timestamp>
            <eb:RefToMessageId>91082930-babb-11e5-b8df-057c6da3c883</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">asds</wsse:BinarySecurityToken>
      </wsse:Security>
   </soap-env:Header>
   <soap-env:Body>
      <OTA_AirAvailRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:stl="http://services.sabre.com/STL/v01" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.3.0">
         <stl:ApplicationResults status="Unknown">
            <stl:Error type="Application" timeStamp="2016-01-14T06:37:31-06:00">
               <stl:SystemSpecificResults>
                  <stl:Message>Sending request to the Host failed</stl:Message>
                  <stl:ShortText>ERR.SWS.HOST.CONNECTOR_ERROR</stl:ShortText>
               </stl:SystemSpecificResults>
            </stl:Error>
         </stl:ApplicationResults>
      </OTA_AirAvailRS>
   </soap-env:Body>
</soap-env:Envelope>

有谁知道问题可能是什么?

如果您需要更多信息,请与我们联系。

回复请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns="http://webservices.sabre.com/sabreXML/2011/10">
   <soapenv:Header>
      <sec:Security>
         <!--Optional:-->
         <!--Optional:-->
         <!--<sec:SabreAth>?</sec:SabreAth>-->
         <!--Optional:-->
         <sec:BinarySecurityToken>rfsd</sec:BinarySecurityToken>
      </sec:Security>
      <mes:MessageHeader mes:version="2.0">
         <mes:From>
            <!--1 or more repetitions:-->
            <mes:PartyId mes:type="urn:x12.org:IO5:01">234552</mes:PartyId>
            <!--Optional:-->
            <!-- <mes:Role>?</mes:Role> -->
         </mes:From>
         <mes:To>
            <!--1 or more repetitions:-->
            <mes:PartyId mes:type="urn:x12.org:IO5:01">123982</mes:PartyId>
            <!--Optional:-->
            <!-- <mes:Role>?</mes:Role> -->
         </mes:To>
         <mes:CPAId>dfsf</mes:CPAId>
         <mes:ConversationId>3424</mes:ConversationId>
         <mes:Service mes:type="OTA">OTA_AirAvailLLSRS</mes:Service>
         <mes:Action>OTA_AirAvailLLSRQ</mes:Action>
         <mes:MessageData>
            <mes:MessageId>766fe600-bb54-11e5-b803-b7a2549d49cb</mes:MessageId>
            <mes:Timestamp>2016-01-15T06:51:54.336Z</mes:Timestamp>
            <!--Optional:-->
            <!-- <mes:RefToMessageId>?</mes:RefToMessageId> -->
            <!--Optional:-->
            <!-- <mes:TimeToLive>?</mes:TimeToLive> -->
            <!--Optional:-->
            <!-- <mes:Timeout>?</mes:Timeout> -->
         </mes:MessageData>
         <!--Optional:-->
         <!-- <mes:DuplicateElimination>?</mes:DuplicateElimination> -->
         <!--Zero or more repetitions:-->
         <!-- <mes:Description xml:lang="?">?</mes:Description> -->
         <!--You may enter ANY elements at this point-->
      </mes:MessageHeader>
   </soapenv:Header>
   <soapenv:Body>

      <ns:OTA_AirAvailRQ Version="2.3.0">
         <!--Optional:-->
         <ns:OptionalQualifiers>
            <!--Optional:-->
            <!-- <ns:AdditionalAvailability AirExtras="?" DirectAccess="?" Ind="?" MoveDown="?"/> -->
            <!--Optional:-->

            <ns:FlightQualifiers DirectOnly="false">

            <!-- <ns:FlightQualifiers Charters="?" DirectOnly="" ExcludeCodeshares="?" Scan="?"> -->
               <!--Optional:-->
               <!-- <ns:AlliancePartner> -->
                  <!-- <ns:Group>?</ns:Group> -->
               <!-- </ns:AlliancePartner> -->
               <!--Optional:-->
               <!-- <ns:Cabin Exclude="?"> -->
                  <!--1 or more repetitions:-->
                  <!-- <ns:Designator>?</ns:Designator> -->
               <!-- </ns:Cabin> -->
               <!--Optional:-->
               <!-- <ns:VendorPrefs DirectAccess="?" Exclude="?"> -->
                  <!--0 to 20 repetitions:-->
                  <!-- <ns:Airline Code="?"/> -->
               <!-- </ns:VendorPrefs> -->
            </ns:FlightQualifiers>
            <!--Optional:-->
            <!-- <ns:TimeQualifiers> -->
               <!--Optional:-->
               <!-- <ns:ArrivalTime WindowAfter="?" WindowBefore="?"/> -->
               <!--Optional:-->
               <!-- <ns:DepartureTime WindowBefore="?" WindowAfter="?"/> -->
            <!-- </ns:TimeQualifiers> -->
         </ns:OptionalQualifiers>
         <!--Optional:-->
         <ns:OriginDestinationInformation>
            <ns:FlightSegment DepartureDateTime="2016-02-01">
            <!-- <ns:FlightSegment DepartureDateTime="2016-02-01" NumberInParty="1"> -->
               <ns:DestinationLocation LocationCode="LAX"/>
               <ns:OriginLocation LocationCode="JFK"/>
            </ns:FlightSegment>

            <!-- <ns:FlightSegment ArrivalDateTime="?" DepartureDateTime="?" FlightNumber="?" NumberInParty="?" ResBookDesigCode="?"> -->
               <!--Optional:-->
               <!-- <ns:ConnectionLocations> -->
                  <!--Optional:-->
                  <!-- <ns:CarrierSpecificDisplay> -->
                     <!-- <ns:LegOne> -->
                        <!-- <ns:VendorPrefs Exclude="?" ExcludeCodeshares="?" Any="?"> -->
                           <!--0 to 20 repetitions:-->
                           <!-- <ns:Airline Code="?"/> -->
                        <!-- </ns:VendorPrefs> -->
                     <!-- </ns:LegOne> -->
                     <!--Optional:-->
                     <!-- <ns:LegThree> -->
                        <!-- <ns:VendorPrefs Exclude="?" ExcludeCodeshares="?" Any="?"> -->
                           <!--0 to 20 repetitions:-->
                           <!-- <ns:Airline Code="?"/> -->
                        <!-- </ns:VendorPrefs> -->
                     <!-- </ns:LegThree> -->
                     <!-- <ns:LegTwo> -->
                        <!-- <ns:VendorPrefs Exclude="?" ExcludeCodeshares="?" Any="?"> -->
                           <!--0 to 20 repetitions:-->
                           <!-- <ns:Airline Code="?"/> -->
                        <!-- </ns:VendorPrefs> -->
                     <!-- </ns:LegTwo> -->
                  <!-- </ns:CarrierSpecificDisplay> -->
                  <!--1 to 2 repetitions:-->
                  <!-- <ns:ConnectionLocation LocationCode="?"> -->
                     <!--Optional:-->
                     <!-- <ns:ConnectTimeOverrides Max="?" Min="?"/> -->
                  <!-- </ns:ConnectionLocation> -->
               <!-- </ns:ConnectionLocations> -->
               <!-- <ns:DestinationLocation LocationCode="?"/> -->
               <!-- <ns:OriginLocation LocationCode="?"/> -->
            <!-- </ns:FlightSegment> -->

         </ns:OriginDestinationInformation>
      </ns:OTA_AirAvailRQ>

   </soapenv:Body>
</soapenv:Envelope>

3 个答案:

答案 0 :(得分:0)

是的,分享请求会有所帮助。 此外,我不确定它是否是拼写错误,但soap标头上的<eb:Action>元素值应为= OTA_AirAvailLLSR Q 而不是OTA_AirAvailLLSR S

如文档中所述:

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

答案 1 :(得分:0)

<mes:Service>值似乎已关闭。你能试试这些价值吗?

  • OTA_AirAvailLLSRQ
  • OTA_AirAvailLLS
  • OTA_AirAvail

另外,检查您是否正在调用正确的端点:https://developer.sabre.com/docs/read/soap_basics/environments

由于错误是ERR.SWS.HOST.CONNECTOR_ERROR,您今天是否尝试过重复通话?也许这只是Sabre方面的一个间歇性问题。

答案 2 :(得分:0)

try the following Code.

header
===========
<eb:ConversationId>1343843</eb:ConversationId>
<eb:Service eb:type="OTA">Air</eb:Service>
<eb:Action>OTA_AirAvailLLSRQ</eb:Action>
<eb:CPAID>123</eb:CPAID>

Body
===============

<OTA_AirAvailRQ Version="1.11.1">
  <POS>
    <Source PseudoCityCode="123"/>
  </POS>
  <SpecificFlightInfo>
    <FlightNumber Number="831"/>
    <Airline Code="9W"/>
    <TPA_Extensions>
      <DepartureDateTime DateTime="2016-01-31T19:30:00"/>
      <OriginLocation LocationCode="MAA"/>
      <DestinationLocation LocationCode="DEL"/>
    </TPA_Extensions>
  </SpecificFlightInfo>
</OTA_AirAvailRQ>