【问题标题】:Check Format error response in Travelport Universal API AirCreateReservationReq检查 Travelport 通用 API AirCreateReservationReq 中的格式错误响应
【发布时间】:2014-11-29 17:45:20
【问题描述】:

我现在正在试用模式下使用Travelport Universal API。我的目标是开发一个 Web 门户来处理客户的 B2B 需求。一切都很好,直到我来到最后第二步,即创建预订(预订)。我尝试按照下面附加的示例 Soap 请求 XML 来用所有必需的参数和数据填充请求对象:Sample XML Request

以下是我编写的请求代码,其中包含示例 xml 请求中描述的详细信息。

var biPoint3 = new BillingPointOfSaleInfo { OriginApplication =      Crediantels.oritionApplication };

var delevieryInfo = new DeliveryInfo
        {
            Email = new Email { EmailID = "test@travelport.com", Type = "Home" },
            PhoneNumber = new PhoneNumber
            {
                CountryCode = "069",
                AreaCode = "49",
                Number = "261111111",
                Type = PhoneNumberType.Mobile,
                Location = "FRA"
            },
            ShippingAddress = new DeliveryInfoShippingAddress
            {
                City = "Como",
                Country = "IT",
                PostalCode = "22100",
                Street = new[] { "Some Street" }
            },
        };

        var travelerDetails = new BookingTraveler
        {
            Key = "0",
            DOB = new DateTime(1976, 11, 18),
            Gender = "M",
            TravelerType = "ADT",
            BookingTravelerName = new BookingTravelerName
            {
                First = "Frederick",
                Last = "Heinrich",
                Prefix = "Herr"
            },
            Address = new[]
            {
                new typeStructuredAddress
                {
                    AddressName = "Smiths",
                    City = "Frankfurt",
                    Country = "DE",
                    PostalCode = "60311",
                    Street = new[] {"Rossmarkt 6"},
                    State = new State {Value = "Hesse"}
                }
            },
            DeliveryInfo = new[]
            {
                new DeliveryInfo
                {
                    Email = new Email {EmailID = "test@travelport.com", Type = "Home"},
                    PhoneNumber = new PhoneNumber
                    {
                        CountryCode = "069",
                        AreaCode = "49",
                        Number = "261111111",
                        Type = PhoneNumberType.Mobile,
                        Location = "FRA"
                    },
                    ShippingAddress = new DeliveryInfoShippingAddress
                    {
                        City = "Frankfurt",
                        Country = "DE",
                        PostalCode = "60311",
                        Street = new[] {"Rossmarkt 6"}
                    }
                }
            },
            Email = new[] { new Email { Type = "Home", EmailID = "test@travelport.com" } },
            PhoneNumber = new[]
            {
                new PhoneNumber
                {
                    CountryCode = "069",
                    AreaCode = "49",
                    Number = "261111111",
                    Type = PhoneNumberType.Mobile,
                    Location = "FRA"
                }
            }
        };

        var reservationRequest = new AirCreateReservationReq
        {
            BillingPointOfSaleInfo = biPoint3,
            TargetBranch = Crediantels.targetBranch,
            AirPricingSolution = airPriceResponse.AirPriceResult[0].AirPricingSolution[0],
            DeliveryInfo = delevieryInfo,
            BookingTraveler = new[] { travelerDetails },
            FormOfPayment = new[]
            {
                new FormOfPayment
                {
                    Type = "Cash",
                    Key = "jwt2mcK1Qp27I2xfpcCtAw=="
                }
            },
            ActionStatus = new[]
            {
                new ActionStatus
                {
                    Type = ActionStatusType.TTL,
                    TicketDate = "2014-12-07T00:00:00",
                    ProviderCode = "1G",
                    QueueCategory = "01"
                }
            },
            AuthorizedBy = "myself",
            RetainReservation = typeRetainReservation.Both,
            TraceId = "1234"
        };

        if (reservationRequest.AirPricingSolution.AirSegmentRef != null)
        {
            var airSegmentRef = reservationRequest.AirPricingSolution.AirSegmentRef[0].Key;
            reservationRequest.AirPricingSolution.AirSegment = new[] { GetAirSegmentByKey(airPriceResponse, airSegmentRef) };
        }
        reservationRequest.AirPricingSolution.AirSegmentRef = null;
        reservationRequest.AirPricingSolution.AirPricingInfo[0].PassengerType[0].BookingTravelerRef = "0";

        var reservationBinding = new AirCreateReservationBinding
        {
            Url = Crediantels.url,
            Credentials = new NetworkCredential(Crediantels.userName, Crediantels.password)
        };
        //SoapException on the following line
        var airReservationResponse = reservationBinding.service(reservationRequest); 

但是当我发送请求时,我在上面代码中提到的最后一行收到了 SoapException。例外是:Ticketing application failed: CHECK FORMAT

通常响应总是包含根据 Web 服务的期望,请求中缺少什么或不存在什么的线索。

我已尝试在请求中添加所有详细信息,即使我不需要其中一些,只是为了匹配示例请求,但此异常仍然没有消失。

如果我故意跳过文档中提到的某些内容,我会收到一个清晰的回复,其中提到了缺失的项目或细节,但不是在原始案例中。

如果有任何想法可以引导我走向正确的方向,我将不胜感激。

【问题讨论】:

    标签: c# asp.net xml soap-client travelport-api


    【解决方案1】:

    通过一些命中和试验解决了这个问题。在这里发布作为答案,以帮助其他人寻找相同的答案。

    由于ActionStatusType.TTL 给出了错误。它需要设置为 ActionStatusType.TAW。 TAW 代表TicketAtWill

    通过更改我的错误已更改为 *0 AVAIL/WL Closed*。但这是因为输入标准没有可预订的航班。将条件更改为更长的出发和返回日期,我收到了包含预订详细信息的有效回复。

    ActionStatus = new[]
    {
        new ActionStatus
        {
            Type = ActionStatusType.TAW, ***
            TicketDate = "2014-12-07T00:00:00",
            ProviderCode = "1G",
            QueueCategory = "01"
        }
     },
    

    【讨论】:

    • 在尝试预订票时您能帮我解决这个异常吗:来自 Galileo 的消息:未捕获的服务异常原因:com.cendant.tds.soa.framework.ServiceException: Exception ReturnedERR: AGENT ID - GALILEO |+动态 GTID 列表为:A809C5
    • 我需要使用 TTL 动作状态,但出现 CHECK FORMAT 错误。
    猜你喜欢
    • 1970-01-01
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 2017-06-16
    • 2016-05-20
    • 2013-07-31
    • 2017-09-28
    相关资源
    最近更新 更多