【问题标题】:Sabre Air Availability Soap Api v-2.4 Throws an Exception ERR.SWS.CLIENT.INVALID_SERVICESabre Air Availability Soap Api v-2.4 引发异常 ERR.SWS.CLIENT.INVALID_SERVICE
【发布时间】:2017-06-23 21:12:53
【问题描述】:

我正在为空气可用性 Sabre api 创建肥皂请求。我正在使用 api 文档中的肥皂参数。首先我请求获取会话令牌,并且我成功获取了一个,但是当我触发 api 请求时,我收到了服务错误。它说我正在使用无效的服务或版本及其 500 错误。我检查了一切,不知道下一步该做什么。请帮忙。

sabre api 链接:https://developer.sabre.com/docs/read/soap_apis/air/search/Air_Availability 这是邮递员的请求sn-p:

<?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>

【问题讨论】:

    标签: web-services soap wsdl soap-client sabre


    【解决方案1】:

    确保 Body 仅包含 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>
    

    【讨论】:

    • 是的,我之前尝试过,但后来出现此错误 向主机发送请求失败ERR.SWS.HOST.CONNECTOR_ERROR
    • 这个 RQ 对我来说很好用。您是否仍然返回相同的错误?还是只有一次?
    • 嗨布鲁诺谢谢你的回复。我相应地尝试了请求,但仍然收到另一个错误“向主机发送请求失败”,所以我很困惑如何解决这个问题。我想我需要知道一些占位符的价值。所以你能告诉我如何获取一些字段的值,比如 CPAId、Service、partyid,最后是 PseudoCityCode。我不知道从哪里得到它们。你也能告诉我这个请求的正确终点吗?谢谢
    • 占位符不是问题,因为我得到了与我提到的修改相同的成功响应。端点记录在此页面上:developer.sabre.com/docs/read/soap_basics/environments 有用信息:developer.sabre.com/resources/getting_started_with_sabre_apis
    • 感谢 Bruno 的快速回复,能否分享您的代码。邮递员文件或您的代码库。谢谢。
    【解决方案2】:

    绑定到 Brunos cmets,以下请求工作正常:

    <?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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多