sabre - BFM v4.2.0 如何添加DepartureDateTime
问题描述
如何在 C# 请求中添加出发日期时间?这是代码的一部分
refOrgDest = new BFMV430.OTA_AirLowFareSearchRQOriginDestinationInformation
{
OriginLocation = new BFMV430.OriginDestinationInformationTypeOriginLocation { LocationCode
= refItin.Origin },
DestinationLocation = new BFMV430.OriginDestinationInformationTypeDestinationLocation { LocationCode = refItin.Destination },
RPH = (i + 1).ToString(),
TPA_Extensions = new BFMV430.OTA_AirLowFareSearchRQOriginDestinationInformationTPA_Extensions
{
CabinPref = new BFMV430.CabinPrefType
{
Cabin = (BFMV430.CabinType)Enum.Parse(typeof(BFMV430.CabinType), refResBookType, true),
PreferLevel = BFMV430.PreferLevelType.Preferred,
CabinSpecified = true,
}
},
ItemElementName = BFMV430.ItemChoiceType.DepartureDateTime,
Item = new BFMV430.TravelDateTimeType
{
DepartureWindow = "00002359",
},
};
refOrgDestList.Add(refOrgDest);
我在运行它时也遇到了这个不匹配错误
ItemElementName 的值与 System.String 的类型不匹配;您需要将其设置为 prjWService.BFMV430.ItemChoiceType.@DepartureDateTime。
任何帮助都会很棒。
提前致谢
解决方案
这是一段可以帮助您的代码,有趣的部分是关于 Sabre 期望的与搜索航班/可用性相关的所有交易的日期格式,这意味着(BMF、ADVShopping、AirLowFare 等将使用相同的日期格式)。(2019-04-14T00:00:00)
__ItemOriginDestination = new AdvacedAirShopping.OTA_AirLowFareSearchRQOriginDestinationInformation
{
RPH = "1",
ItemElementName = AdvacedAirShopping.ItemChoiceType.DepartureDateTime,
Item = _FlightSearch.DepartureDateTime, //"2019-04-14T00:00:00" Here is the format expected by Sabre
OriginLocation = new AdvacedAirShopping.OriginDestinationInformationTypeOriginLocation
{
LocationCode = _FlightSearch.Origin
},
DestinationLocation = new AdvacedAirShopping.OriginDestinationInformationTypeDestinationLocation
{
LocationCode = _FlightSearch.Destination
}
};
推荐阅读
- nginx - 多个反应应用程序未在 nginx 中运行
- python - Numpy 将非零元素从一个数组复制到另一个(3D 数组)
- python - Pandas - 基于其他列创建新列,不包括第一行
- javascript - 管理根据对象内的两个值合并两个数组
- java - 在 Google 地图上更改位置后更新 TextView
- python - 预测 NaN、无穷大或对于 dtype('float64') 来说太大的值
- php - 每次尝试的 Laravel Google Authenticator 应用程序无效代码
- cxf - 请求标头中的 Keycloak 身份验证用户
- awk - sh 按匹配的列名值打破 CSV 文件,同时保留标题
- android - 'Iterable 类型的值
' 不能从函数 '_recentTransactions' 中返回,因为它的返回类型为 'List