Sabre通过地址SOAP API获取酒店可用性

时间:2017-08-31 11:01:51

标签: soap sabre

我正在尝试通过地址请求酒店可用性(OTA_HotelAvailRQ)  例如:

<OTA_HotelAvailRQ Version="2.3.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">
                    <AvailRequestSegment>
                        <Customer>
                            <Corporate>
                                <ID>ABC123</ID>
                            </Corporate>
                        </Customer>
                        <GuestCounts Count="2"/>
                        <HotelSearchCriteria>
                            <Criterion>
                                <Address>
                                    <CityName>SOUTHLAKE</CityName>
                                    <CountryCode>US</CountryCode>
                                </Address>
                            </Criterion>
                        </HotelSearchCriteria>
                        <TimeSpan End="10-24" Start="10-22" />
                    </AvailRequestSegment>
                </OTA_HotelAvailRQ>

并且我无法在响应中得到结果,我一直在接收:

    <?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">ws</eb:PartyId></eb:From><eb:To><eb:PartyId eb:type="urn:x12.org:IO5:01">from</eb:PartyId></eb:To><eb:CPAId>3IHI</eb:CPAId><eb:ConversationId>998</eb:ConversationId><eb:Service eb:type="sabreXML">256444039988570150</eb:Service><eb:Action>OTA_HotelAvailLLSRS</eb:Action><eb:MessageData><eb:MessageId>1090003241665830150</eb:MessageId><eb:Timestamp>2017-08-31T06:42:46</eb:Timestamp></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!-3237679358254869625!1952915!0</wsse:BinarySecurityToken></wsse:Security></soap-env:Header><soap-env:Body><OTA_HotelAvailRS 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.3.0">
 <stl:ApplicationResults status="NotProcessed">
  <stl:Error type="BusinessLogic" timeStamp="2017-08-31T01:42:46-05:00">
   <stl:SystemSpecificResults>
    <stl:Message code="0">NO AVAIL</stl:Message>
    <stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
   </stl:SystemSpecificResults>
  </stl:Error>
 </stl:ApplicationResults>

我尝试使用HotelCode在军刀页面中的示例并且它有效,但我需要通过地址请求它,那么请求设计应该是什么?谢谢

1 个答案:

答案 0 :(得分:0)

假的公司ID没有帮助。你还需要城市代码。

尝试这样的事情:

<OTA_HotelAvailRQ Version="2.3.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" ReturnHostCommand="true">
        <AvailRequestSegment>
            <GuestCounts Count="2"/>
            <HotelSearchCriteria>
                <Criterion>
                    <Address>
                        <CityName>SOUTH LAKE</CityName>
                        <CountryCode>US</CountryCode>
                    </Address>
                    <HotelRef HotelCityCode="TVL"/>
                </Criterion>
            </HotelSearchCriteria>
            <TimeSpan End="10-24" Start="10-22" />
        </AvailRequestSegment>
    </OTA_HotelAvailRQ>

注意南湖的空间

如果您需要从城市名称获取城市代码,可以使用EncodeDecodeLLSRQ:

<EncodeDecodeRQ 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" Version="2.0.0">
    <Encode>
        <Address>
            <CityName>south lake</CityName>
        </Address>
    </Encode>
</EncodeDecodeRQ>

<EncodeDecodeRS 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="Complete">
        <stl:Success timeStamp="2017-09-05T11:35:59-05:00"/>
    </stl:ApplicationResults>
    <Text>TVL   SOUTH LAKE TAHOE, CALIFORNIA,USA</Text>
</EncodeDecodeRS>