StructureFareRulesRQ解析失败-Visual Studio Web参考命名约定错误?

时间:2019-05-21 19:00:11

标签: c# web-services soap wsdl sabre

我正在尝试从Saber调用StructureFareRulesRQ API,但似乎该API与其他Sabre API不同。在将wsdl文件添加到我的项目之后,我期望Web Service调用方法被命名为StructureFareRulesRQService之类的名称,但是该名称不存在。相反,我将StructureFareRulesRQ作为实际服务,而将StructureFareRulesRQ1作为XML消息的包装器类。由于包装器类的名称错误,因此在对其进行序列化时,它将创建伪造的XML消息(请参见下文)。

我知道我可能可以浏览reference.cs文件并进行查找/替换,但是我担心这样做将需要我在新版本上线时执行相同的操作。还有其他人遇到这个问题,还是我疯了?

示例XML有效负载,它从Sabre返回“ Error ErrorCode =“ 009400” ErrorMessage =“ PARSE FAILURE-INVALID REQUEST”响应:

<?xml version="1.0" encoding="utf-16"?>
<StructureFareRulesRQ1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <PriceRequestInformation CurrencyCode="USD" BuyingDate="2019-05-21T13:46:00" xmlns="http://webservices.sabre.com/sabreXML/2003/07">
    <PassengerTypes>
      <PassengerType Code="ADT" />
    </PassengerTypes>
    <ReturnAllData />
  </PriceRequestInformation>
  <AirItinerary xmlns="http://webservices.sabre.com/sabreXML/2003/07">
    <OriginDestinationOptions>
      <OriginDestinationOption>
        <FlightSegment SegmentType="A" DepartureDate="2019-08-17T17:35:00" BookingDate="2019-05-21T13:46:00" RealReservationStatus="SS">
          <DepartureAirport LocationCode="ORD" />
          <ArrivalAirport LocationCode="HEL" />
          <MarketingAirline Code="AY" />
          <OperatingAirline Code="AY" />
        </FlightSegment>
        <PaxTypeInformation FareBasisCode="IFLE2US2" PassengerType="ADT" FareComponentNumber="0" />
      </OriginDestinationOption>
      <OriginDestinationOption>
        <FlightSegment SegmentType="A" DepartureDate="2019-08-18T13:25:00" BookingDate="2019-05-21T13:46:00" RealReservationStatus="SS">
          <DepartureAirport LocationCode="HEL" />
          <ArrivalAirport LocationCode="SVO" />
          <MarketingAirline Code="AY" />
          <OperatingAirline Code="SU" />
        </FlightSegment>
        <PaxTypeInformation FareBasisCode="IFLE2US2" PassengerType="ADT" FareComponentNumber="0" />
      </OriginDestinationOption>
      <OriginDestinationOption>
        <FlightSegment SegmentType="A" DepartureDate="2019-08-29T10:40:00" BookingDate="2019-05-21T13:46:00" RealReservationStatus="SS">
          <DepartureAirport LocationCode="SVO" />
          <ArrivalAirport LocationCode="HEL" />
          <MarketingAirline Code="AY" />
          <OperatingAirline Code="SU" />
        </FlightSegment>
        <PaxTypeInformation FareBasisCode="IFLE2US2" PassengerType="ADT" FareComponentNumber="0" />
      </OriginDestinationOption>
      <OriginDestinationOption>
        <FlightSegment SegmentType="A" DepartureDate="2019-08-29T13:55:00" BookingDate="2019-05-21T13:46:00" RealReservationStatus="SS">
          <DepartureAirport LocationCode="HEL" />
          <ArrivalAirport LocationCode="ORD" />
          <MarketingAirline Code="AY" />
          <OperatingAirline Code="AY" />
        </FlightSegment>
        <PaxTypeInformation FareBasisCode="IFLE2US2" PassengerType="ADT" FareComponentNumber="0" />
      </OriginDestinationOption>
    </OriginDestinationOptions>
  </AirItinerary>
</StructureFareRulesRQ1>

1 个答案:

答案 0 :(得分:0)

您好,我认为StructureFareRulesRQ1必须为StructureFareRulesRQ。 https://beta.developer.sabre.com/docs/soap_apis/air/utility/get_structured_fare_rules