Travelport / travelport-uapi-tutorial-c-sharp

The travelport-uapi-tutorial-c-sharp is a C# project for Universal API that will help you connect and code a standard Air availablity call and Hotel search, details, and booking flow.
35 stars 30 forks source link

[Error] :1:602: cvc-complex-type.4: Attribute 'Key' must appear on element 'AirPricingSolution' #223

Open salmanelahi93 opened 3 years ago

salmanelahi93 commented 3 years ago

Im receiving following exception while booking a flight.

Attribute 'Key' must appear on element 'AirPricingSolution'

Please find the req xml below:

<AirCreateReservationReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetBranch="PXXXXXXX" RetainReservation="Both">
  <BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v49_0" />
  <BookingTraveler Key="42201-5464346-4" TravelerType="ADT" DOB="2020-08-11" xmlns="http://www.travelport.com/schema/common_v49_0">
    <BookingTravelerName Prefix="Mr" First="SARFARAZ" Last="KHAN" />
    <PhoneNumber CountryCode="" Number="03432244666" />
    <Email EmailID="salman@gmail.com" />
  </BookingTraveler>
  <AirPricingSolution xmlns="http://www.travelport.com/schema/air_v49_0">
    <AirSegment Key="eb1oOkAqWDKAp8kDFAAAAA==" Group="0" Carrier="PK" FlightNumber="310" Origin="KHI" Destination="UET" DepartureTime="2021-08-01T11:00:00.000" ArrivalTime="2021-08-01T12:20:00.000" ClassOfService="H" />
    <AirSegment Key="eb1oOkAqWDKAs8kDFAAAAA==" Group="0" Carrier="PK" FlightNumber="323" Origin="UET" Destination="LHE" DepartureTime="2021-08-01T18:45:00.000" ArrivalTime="2021-08-01T20:05:00.000" ClassOfService="H" />
    <AirSegment Key="eb1oOkAqWDKAv8kDFAAAAA==" Group="0" Carrier="PK" FlightNumber="757" Origin="LHE" Destination="LHR" DepartureTime="2021-08-02T12:50:00.000" ArrivalTime="2021-08-02T16:00:00.000" ClassOfService="V" />
    <AirPricingInfo PricingMethod="Auto" PlatingCarrier="PK" Key="eb1oOkAqWDKAj8kDFAAAAA==">
      <FareInfo EffectiveDate="2021-05-06T14:27:00.000+05:00" Destination="LHR" Origin="KHI" PassengerTypeCode="ADT" FareBasis="VLOWPK" Key="eb1oOkAqWDKAi8kDFAAAAA==" />
      <BookingInfo BookingCode="H" FareInfoRef="eb1oOkAqWDKAi8kDFAAAAA==" />
      <BookingInfo BookingCode="H" FareInfoRef="eb1oOkAqWDKAi8kDFAAAAA==" />
      <BookingInfo BookingCode="V" FareInfoRef="eb1oOkAqWDKAi8kDFAAAAA==" />
      <PassengerType Code="ADT" BookingTravelerRef="42201-5464346-4" />
    </AirPricingInfo>
  </AirPricingSolution>
  <ActionStatus Type="TAW" TicketDate="2021-05-06T14:29:04.915+05:00" ProviderCode="1G" xmlns="http://www.travelport.com/schema/common_v49_0" />
</AirCreateReservationReq> 
RicOsiro commented 3 years ago

hi,

it's schema validation error. You should check all required data and content type. the element AirPricingSolution you just open it, if you compare to AirPriceRsp there are more xml attributes there, the "Key" it not in your request

a sample of this element but check all the elements, not only the attributes.
AlbinaAziz commented 3 years ago

Travelport recommends pass all the attributes and elements to the next request without any change. It means if u get key, flightid,duration etc. Then pass all those attributes.