Travelport / travelport-uapi-tutorial

The travelport-uapi-tutorial is a Java project for Universal API that will help you connect and code a standard workflow including Air and Hotel.
45 stars 34 forks source link

LowFareSearchReq with CityOrAirport giving error #236

Open sharma-hitesh opened 7 years ago

sharma-hitesh commented 7 years ago

Here is the request XML

I am getting the following error response: Server.InvalidRequestException [Error] :1:746: cvc-enumeration-valid: Value 'mi' is not facet-valid with respect to enumeration '[MI, KM]'. It must be a value from the enumeration. 1000 WEBSVC Data Validation failed on request message. F35876A90A07647856399320E84D634C LastElement CityOrAirport Units=mi Value=50
vivekjyotipramanik commented 7 years ago

Hi sharma-hitesh,

Could you please try with the below request. Please let me know how it goes. Thanks.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:LowFareSearchReq TargetBranch="TRGT_BRCH" xmlns="http://www.travelport.com/schema/common_v38_0" xmlns:ns2="http://www.travelport.com/schema/air_v38_0" xmlns:ns3="http://www.travelport.com/schema/vehicle_v38_0" xmlns:ns4="http://www.travelport.com/soa/common/security/SessionContext_v1" xmlns:ns5="http://www.travelport.com/schema/rail_v38_0" xmlns:ns6="http://www.travelport.com/schema/universal_v38_0" xmlns:ns7="http://www.travelport.com/schema/hotel_v38_0" xmlns:ns8="http://www.travelport.com/schema/passive_v38_0" xmlns:ns9="http://www.travelport.com/schema/cruise_v38_0">
         <BillingPointOfSaleInfo OriginApplication="UAPI"/>
         <ns2:SearchAirLeg>
            <ns2:SearchOrigin>
               <CityOrAirport Code="PIT" PreferCity="true"/>
            </ns2:SearchOrigin>
            <ns2:SearchDestination>
               <CityOrAirport Code="JFK" PreferCity="true"/>
            </ns2:SearchDestination>
            <ns2:SearchDepTime PreferredTime="2016-12-19">
               <SearchExtraDays DaysBefore="1" DaysAfter="1"/>
            </ns2:SearchDepTime>
            <ns2:AirLegModifiers>
               <ns2:PreferredCabins>
                  <CabinClass Type="Economy"/>
               </ns2:PreferredCabins>
            </ns2:AirLegModifiers>
         </ns2:SearchAirLeg>
         <ns2:AirSearchModifiers>
            <ns2:PreferredProviders>
               <Provider Code="1G"/>
            </ns2:PreferredProviders>
         </ns2:AirSearchModifiers>
         <SearchPassenger Code="ADT"/>
         <ns2:AirPricingModifiers CurrencyType="USD"/>
         <ns2:PCC>
            <PointOfSale ProviderCode="1G" PseudoCityCode="PIT"/>
         </ns2:PCC>
      </ns2:LowFareSearchReq>
   </soap:Body>
</soap:Envelope>

Thanks & Regards Vivekjyoti Pramanik

sharma-hitesh commented 7 years ago

Fixed it by setting the "Distance" object null.