sabre - 如何使用 OTA_AirPriceRQ API 获取航班票价税
问题描述
我正在使用 OTA_AirAvailRQ API 来获取可用航班的列表。我想获取航班的票价和税收信息,但 OTA_AirPriceRQ API 给了我一个错误。
这是我的要求:
<OTA_AirPriceRQ Version="2.17.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 ArrivalDateTime="2019-02-21T17:00" ConnectionInd="O" DepartureDateTime="2019-02-21T15:00" FlightNumber="802" ResBookDesigCode="Y" RPH="1">
<DestinationLocation LocationCode="KUL"/>
<MarketingCarrier Code="OD" FlightNumber="802"/>
<OriginLocation LocationCode="SIN"/>
</FlightSegment>
</OriginDestinationInformation>
<PriceRequestInformation Retain="true">
<OptionalQualifiers>
<PricingQualifiers CurrencyCode="USD">
<PassengerType Code="ADT" Force="true" Quantity="1"/>
</PricingQualifiers>
</OptionalQualifiers>
</PriceRequestInformation>
</OTA_AirPriceRQ>
这是 API 的响应:
<OTA_AirPriceRS 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.17.0">
<stl:ApplicationResults status="NotProcessed">
<stl:Error type="BusinessLogic" timeStamp="2019-01-29T02:59:18-06:00">
<stl:SystemSpecificResults>
<stl:Message>FORMAT, CHECK SEGMENT NUMBER-0003</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</OTA_AirPriceRS>
解决方案
您可能希望删除请求中的 OriginDestination 节点。根据未使用的服务设计:
<!-- Optional -->
<!-- Repeat Factor=0 -->
<!--Please note that this node is reserved for future expansion and is not currently in use.-->
我建议在主请求节点中使用 ReturnHostCommand="true" 属性以返回 WP 格式,并能够查看您发送到本机 Sabre 的格式。
推荐阅读
- .net - 如果后台线程不访问 Office 对象模型,是否需要在 MS Office 加载项中作为 STA 线程运行?
- asp.net-mvc - 为列表创建一个隐藏输入并将其发送回 mvc 核心中的帖子
- c# - 无法从克隆的仓库构建项目
- markdown - 如何在 Microsoft Teams 中粘贴 Markdown?
- java - 在 Eclipse 中为 Java 和 Java EE 使用相同的工作区
- c#-4.0 - Foreach C# 中的 Foreach
- java - 如何访问类的特定实例的值?
- ruby-on-rails - 将 Chartkick 与仅使用 rails 5.2 api 的应用程序集成?
- python - 为什么发送电子邮件时 html 表会被截断?
- python - Tkinter ImageTk - 如何将图像标签插入框架?