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

Air Create Reservation Request #44

Closed szrz92 closed 8 years ago

szrz92 commented 8 years ago

Hello I am sending AirCreateReservationReq as string requestText = string.Format(CultureInfo.InvariantCulture, "<AirCreateReservationReq xmlns:air='http://www.travelport.com/schema/air_v26_0' TraceId='d16ff6de-9808-46f8-be95-7fe5faf3f1c6' TargetBranch='P7059888'><BillingPointOfSaleInfo xmlns='http://www.travelport.com/schema/common_v26_0' OriginApplication='UAPI'/>"+ "<BookingTraveler>" + "<BookingTravelerName First='Zain' Last='Raza'/><PhoneNumber Number='03415010849'/><Email EmailID='zain.raza@sonyatravels.net'/>"+ "<SSR Type='DOCS'/>"+ "<Address><AddressName>Sonya Travels</AddressName><Street>Banni Gala</Street><City>Islamabad</City><State>Pakistan</State><PostalCode>44000</PostalCode><Country>Pakistan</Country></Address>"+ "</BookingTraveler>"+ "<FormOfPayment xmlns='http://www.travelport.com/schema/common_v26_0' Key='jwt2mcK1Qp27I2xfpcCtAw==' Type='Cash'/>"+ "<AirPricingSolution Key='wCDOpNUMTdWPy0xfLQfELQ==' TotalPrice='GBP510.60' BasePrice='PKR17600' ApproximateTotalPrice='GBP510.60' ApproximateBasePrice='GBP128.00' EquivalentBasePrice='GBP128.00' Taxes='GBP382.60' ApproximateTaxes='GBP382.60'><Journey TravelTime='P0DT7H25M0S'><AirSegmentRef Key='2oko/bJzTtqrK88gGdizlg=='/><AirSegmentRef Key='I77A/QDVRSiyMnPDvz5W5g=='/></Journey><Journey TravelTime='P0DT13H0M0S'><AirSegmentRef Key='i2Y0aCqyQEO6Zl5A3JeqOg=='/><AirSegmentRef Key='0ogSgN7JSMG6KnQn80kFcw=='/></Journey><LegRef Key='JIcF5tW+QUSW+r3EyC/Wgw=='/><LegRef Key='VKg3kWENQhS71QNQr3CIEA=='/><AirPricingInfo Key='l1JuyyahRhOTC7MUDewV8g==' TotalPrice='GBP255.30' BasePrice='PKR8800' ApproximateTotalPrice='GBP255.30' ApproximateBasePrice='GBP64.00' EquivalentBasePrice='GBP64.00' Taxes='GBP191.30' ApproximateTaxes='GBP191.30' LatestTicketingTime='2016-08-25T23:59:00.000+01:00' PricingMethod='Guaranteed' Refundable='true' ETicketability='Yes' PlatingCarrier='WY' ProviderCode='1G'><FareInfoRef Key='SvWq2sRpSKadENDl2Gvy1w=='/><FareInfoRef Key='/d/KaPeARmixd2gMNMpL9A=='/><BookingInfo BookingCode='U' CabinClass='Economy' FareInfoRef='SvWq2sRpSKadENDl2Gvy1w==' SegmentRef='2oko/bJzTtqrK88gGdizlg=='/><BookingInfo BookingCode='U' CabinClass='Economy' FareInfoRef='SvWq2sRpSKadENDl2Gvy1w==' SegmentRef='I77A/QDVRSiyMnPDvz5W5g=='/><BookingInfo BookingCode='U' CabinClass='Economy' FareInfoRef='/d/KaPeARmixd2gMNMpL9A==' SegmentRef='i2Y0aCqyQEO6Zl5A3JeqOg=='/><BookingInfo BookingCode='U' CabinClass='Economy' FareInfoRef='/d/KaPeARmixd2gMNMpL9A==' SegmentRef='0ogSgN7JSMG6KnQn80kFcw=='/><TaxInfo Category='RG' Amount='GBP36.10'/><TaxInfo Category='SP' Amount='GBP10.80'/><TaxInfo Category='XZ' Amount='GBP7.40'/><TaxInfo Category='YD' Amount='GBP7.40'/><TaxInfo Category='OM' Amount='GBP4.00'/><TaxInfo Category='AE' Amount='GBP15.40'/><TaxInfo Category='F6' Amount='GBP7.20'/><TaxInfo Category='TP' Amount='GBP1.00'/><TaxInfo Category='ZR' Amount='GBP1.00'/><TaxInfo Category='YQ' Amount='GBP101.00'/><FareCalc>ISB WY X/MCT WY DXB 42.12USPT3MPK WY X/MCT WY ISB 42.12USPT3MPK NUC84.24END ROE104.452</FareCalc><PassengerType Code='ADT' Age='40'/><PassengerType Code='ADT' Age='40'/></AirPricingInfo><Connection SegmentIndex='0'/><Connection SegmentIndex='2'/></AirPricingSolution>"+ "<ActionStatus xmlns='http://www.travelport.com/schema/common_v26_0' Type='TAW'/>"+ "</AirCreateReservationReq>"

and i am getting response as fault instead of pnr `

Server.InvalidRequestException [Error] :1:277: cvc-elt.1: Cannot find the declaration of element 'AirCreateReservationReq'. 1000 WEBSVC Data Validation failed on request message. C07B58C70A07643CDDB748F782130411 ` Thanks in advance for your assistance
NirandaG commented 8 years ago

Hi SyedZainZaidi,

The reason why the request fails is you have not define the XML request with the correct namespaces. Please have a look on the below working request. I have done the AirPrice first and from the response of that I am sending to AirCreate. It is always recommended to do the AirPrice and get the AirPricingSolution and pass to AirCreate to ensure the fares are valid for the itinerary.

com:BookingTraveler com:Address com:AddressNameSonya Travels/com:AddressName com:StreetBanni Gala/com:Street com:CityIslamabad/com:City com:StatePK/com:State com:PostalCode44000/com:PostalCode com:CountryPK/com:Country /com:Address /com:BookingTraveler /air:AirSegment 6UUVoSldxwggqQgBbEgvbMbKj3F8T9EyxsqPcXxP0TIjSPOlaHfQe8rMosN4ns/3WnkVG8wp+G+qTzrOkj9IsOeOmxNUrHJfQXTbv5GqBu/o7xiNQMqKqUL9ggS4kR6WMZUte92KOl5hyz3dw3tp7Z2Pytk8RQ2fvHhv2oaRjy+J+Ch/CByPt2RVHMJxjEnEncXF8dnoCNBHJgPyZEDsbM869eStP5yQfaaYC8WpFBTzd9nfIIA9qmV8BqhKlF9D6w+VIx6G4TdUK6WozBuk1v32JSjnS9AAlimtelR3PK0OWVVYOB6MBUlPIHnH21hJVvL0gTWvGVKq584JjFOiNyDmMUgZyvVGF3an3g/ZLqvbFiLfSgMHF4B1xjSbRrjKo8SiRzsqzTd2P6QlvL6GUK1QS/r7yshTy5YV9dV3U4CXLmrFneovA5cuasWd6i8Dly5qxZ3qLwOXLmrFneovAzzD4Wdjal2fHna1H5QsLdGaNi6zOfbTtY770mJHGJ8MiSbHVnPfQgDzLMlBTZoZc9wXtO9a1rEPcUksFbQFL/I=/air:FareRuleKey Economy Flexi Saver/air:Title FlexiSaver/air:Title Our Economy Class innovative design minimizes intrusion into your personal space even as the passenger in front reclines; while ergonomic styling of the seat further maximizes knee and legroom. It also features a headrest that can be adjusted as desired for greater support. ``` An easily accessible seatback-mounted handset, personal and non-intrusive reading light and in-seat power supply, are just some of the many intelligent touches designed with you in mind. (Applicable to most aircraft types) Enjoy the ability to change your flight dates for free and earn twice as many miles when you book an Economy Flexi Saver trip instead! You get: 1) Ability to change flight dates 2) 2 times as many miles accrued Our Economy Class innovative design minimizes intrusion into your personal space even as the passenger in front reclines; while ergonomic styling of the seat further maximizes knee and legroom. It also features a headrest that can be adjusted as desired for greater support. An easily accessible seatback-mounted handset, personal and non-intrusive reading light and in-seat power supply, are just some of the many intelligent touches designed with you in mind. (Applicable to most aircraft types) Flexibility with amazing value https://merchandisingmanagement.travelport.com/documents/10431/13649/YCL.jpg MEL SQ SIN 258.21WPROWAUPO NUC258.21END ROE1.347694 VND118900 MYTRIPANDMORE.COM/BAGGAGEDETAILSSQ.BAGG 30K BAGGAGE DISCOUNTS MAY APPLY BASED ON FREQUENT FLYER STATUS/ ONLINE CHECKIN/FORM OF PAYMENT/MILITARY/ETC. CHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE CHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE 1P CARRYON HAND BAGGAGE ALLOWANCE RATE USED IN EQU TOTAL IS BSR 1AUD - 16983.974VND TOUR CODE: POO LAST DATE TO PURCHASE TICKET: 08NOV16 TICKETING AGENCY 7C0M DEFAULT PLATING CARRIER SQ FARE HAS A PLATING CARRIER RESTRICTION E-TKT REQUIRED TICKETING FEES MAY APPLY GFB10101ADT00 01WPROW 010001#GFB200010101NADTV3912HOAU00100002997725975267EH# ``` Also please have a look on the following help links which will give you a better understanding on the transactions. Thank you, Niranda
NirandaG commented 8 years ago
com:BookingTraveler com:Address com:AddressNameSonya Travels/com:AddressName com:StreetBanni Gala/com:Street com:CityIslamabad/com:City com:StatePK/com:State com:PostalCode44000/com:PostalCode com:CountryPK/com:Country /com:Address /com:BookingTraveler /air:AirSegment 6UUVoSldxwggqQgBbEgvbMbKj3F8T9EyxsqPcXxP0TIjSPOlaHfQe8rMosN4ns/3WnkVG8wp+G+qTzrOkj9IsOeOmxNUrHJfQXTbv5GqBu/o7xiNQMqKqUL9ggS4kR6WMZUte92KOl5hyz3dw3tp7Z2Pytk8RQ2fvHhv2oaRjy+J+Ch/CByPt2RVHMJxjEnEncXF8dnoCNBHJgPyZEDsbM869eStP5yQfaaYC8WpFBTzd9nfIIA9qmV8BqhKlF9D6w+VIx6G4TdUK6WozBuk1v32JSjnS9AAlimtelR3PK0OWVVYOB6MBUlPIHnH21hJVvL0gTWvGVKq584JjFOiNyDmMUgZyvVGF3an3g/ZLqvbFiLfSgMHF4B1xjSbRrjKo8SiRzsqzTd2P6QlvL6GUK1QS/r7yshTy5YV9dV3U4CXLmrFneovA5cuasWd6i8Dly5qxZ3qLwOXLmrFneovAzzD4Wdjal2fHna1H5QsLdGaNi6zOfbTtY770mJHGJ8MiSbHVnPfQgDzLMlBTZoZc9wXtO9a1rEPcUksFbQFL/I=/air:FareRuleKey Economy Flexi Saver/air:Title FlexiSaver/air:Title Our Economy Class innovative design minimizes intrusion into your personal space even as the passenger in front reclines; while ergonomic styling of the seat further maximizes knee and legroom. It also features a headrest that can be adjusted as desired for greater support. An easily accessible seatback-mounted handset, personal and non-intrusive reading light and in-seat power supply, are just some of the many intelligent touches designed with you in mind. (Applicable to most aircraft types) /air:Text Enjoy the ability to change your flight dates for free and earn twice as many miles when you book an Economy Flexi Saver trip instead! You get: 1) Ability to change flight dates 2) 2 times as many miles accrued /air:Text Our Economy Class innovative design minimizes intrusion into your personal space even as the passenger in front reclines; while ergonomic styling of the seat further maximizes knee and legroom. It also features a headrest that can be adjusted as desired for greater support. An easily accessible seatback-mounted handset, personal and non-intrusive reading light and in-seat power supply, are just some of the many intelligent touches designed with you in mind. (Applicable to most aircraft types) /air:Text Flexibility with amazing value/air:Text https://merchandisingmanagement.travelport.com/documents/10431/13649/YCL.jpg/air:ImageLocation /air:Brand /air:FareInfo air:FareCalcMEL SQ SIN 258.21WPROWAUPO NUC258.21END ROE1.347694/air:FareCalc air:ChangePenalty air:AmountVND118900/air:Amount /air:ChangePenalty air:BaggageAllowances air:URLInfo air:URLMYTRIPANDMORE.COM/BAGGAGEDETAILSSQ.BAGG/air:URL /air:URLInfo air:TextInfo air:Text30K/air:Text air:TextBAGGAGE DISCOUNTS MAY APPLY BASED ON FREQUENT FLYER STATUS/ ONLINE CHECKIN/FORM OF PAYMENT/MILITARY/ETC./air:Text /air:TextInfo air:BaggageRestriction air:TextInfo air:TextCHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:BagDetails air:BaggageRestriction air:TextInfo air:TextCHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:BagDetails /air:BaggageAllowanceInfo air:TextInfo air:Text1P/air:Text /air:TextInfo air:BaggageRestriction air:TextInfo air:TextCARRYON HAND BAGGAGE ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:CarryOnDetails /air:CarryOnAllowanceInfo /air:BaggageAllowances /air:AirPricingInfo RATE USED IN EQU TOTAL IS BSR 1AUD - 16983.974VND/air:FareNote TOUR CODE: POO/air:FareNote LAST DATE TO PURCHASE TICKET: 08NOV16/air:FareNote TICKETING AGENCY 7C0M/air:FareNote DEFAULT PLATING CARRIER SQ/air:FareNote FARE HAS A PLATING CARRIER RESTRICTION/air:FareNote E-TKT REQUIRED/air:FareNote TICKETING FEES MAY APPLY/air:FareNote GFB10101ADT00 01WPROW 010001#GFB200010101NADTV3912HOAU00100002997725975267EH# /air:AirPricingSolution /univ:AirCreateReservationReq
NirandaG commented 8 years ago

Sorry since the sample does not gets attached correctly.

NirandaG commented 8 years ago
com:BookingTraveler com:Address com:AddressNameSonya Travels/com:AddressName com:StreetBanni Gala/com:Street com:CityIslamabad/com:City com:StatePK/com:State com:PostalCode44000/com:PostalCode com:CountryPK/com:Country /com:Address /com:BookingTraveler /air:AirSegment 6UUVoSldxwggqQgBbEgvbMbKj3F8T9EyxsqPcXxP0TIjSPOlaHfQe8rMosN4ns/3WnkVG8wp+G+qTzrOkj9IsOeOmxNUrHJfQXTbv5GqBu/o7xiNQMqKqUL9ggS4kR6WMZUte92KOl5hyz3dw3tp7Z2Pytk8RQ2fvHhv2oaRjy+J+Ch/CByPt2RVHMJxjEnEncXF8dnoCNBHJgPyZEDsbM869eStP5yQfaaYC8WpFBTzd9nfIIA9qmV8BqhKlF9D6w+VIx6G4TdUK6WozBuk1v32JSjnS9AAlimtelR3PK0OWVVYOB6MBUlPIHnH21hJVvL0gTWvGVKq584JjFOiNyDmMUgZyvVGF3an3g/ZLqvbFiLfSgMHF4B1xjSbRrjKo8SiRzsqzTd2P6QlvL6GUK1QS/r7yshTy5YV9dV3U4CXLmrFneovA5cuasWd6i8Dly5qxZ3qLwOXLmrFneovAzzD4Wdjal2fHna1H5QsLdGaNi6zOfbTtY770mJHGJ8MiSbHVnPfQgDzLMlBTZoZc9wXtO9a1rEPcUksFbQFL/I=/air:FareRuleKey /air:FareInfo air:FareCalcMEL SQ SIN 258.21WPROWAUPO NUC258.21END ROE1.347694/air:FareCalc air:ChangePenalty air:AmountVND118900/air:Amount /air:ChangePenalty air:BaggageAllowances air:URLInfo air:URLMYTRIPANDMORE.COM/BAGGAGEDETAILSSQ.BAGG/air:URL /air:URLInfo air:TextInfo air:Text30K/air:Text air:TextBAGGAGE DISCOUNTS MAY APPLY BASED ON FREQUENT FLYER STATUS/ ONLINE CHECKIN/FORM OF PAYMENT/MILITARY/ETC./air:Text /air:TextInfo air:BaggageRestriction air:TextInfo air:TextCHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:BagDetails air:BaggageRestriction air:TextInfo air:TextCHGS MAY APPLY IF BAGS EXCEED TTL WT ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:BagDetails /air:BaggageAllowanceInfo air:TextInfo air:Text1P/air:Text /air:TextInfo air:BaggageRestriction air:TextInfo air:TextCARRYON HAND BAGGAGE ALLOWANCE/air:Text /air:TextInfo /air:BaggageRestriction /air:CarryOnDetails /air:CarryOnAllowanceInfo /air:BaggageAllowances /air:AirPricingInfo RATE USED IN EQU TOTAL IS BSR 1AUD - 16983.974VND/air:FareNote TOUR CODE: POO/air:FareNote LAST DATE TO PURCHASE TICKET: 08NOV16/air:FareNote TICKETING AGENCY 7C0M/air:FareNote DEFAULT PLATING CARRIER SQ/air:FareNote FARE HAS A PLATING CARRIER RESTRICTION/air:FareNote E-TKT REQUIRED/air:FareNote TICKETING FEES MAY APPLY/air:FareNote GFB10101ADT00 01WPROW 010001#GFB200010101NADTV3912HOAU00100002997725975267EH# /air:AirPricingSolution /univ:AirCreateReservationReq
NirandaG commented 8 years ago

AirCreate.txt

NirandaG commented 8 years ago

Please find the attached sample for AirCreate.

szrz92 commented 8 years ago

Thanks a lot it worked :D