如何从GetReservationRS及Retrieve Itinerary服务的GetReservationRS判断预订是否通过网页完成
Great question—let’s break this down clearly, since both of your scenarios center on parsing the same GetReservationRS structure (whether it’s a direct response or returned via the Retrieve Itinerary service).
Core Logic for Both Scenarios
The key is to look for booking channel metadata embedded in the GetReservationRS response. Most GDS/booking systems structure this consistently, though exact node names might vary slightly by provider (Sabre, Amadeus, Travelport, etc.). Here’s the step-by-step breakdown:
- Locate the booking channel node: Typically found under the path
Reservation/ReservationInfo/BookingChannel(or a similar nested structure likeReservation/Sourcedepending on the system). - Check the channel identifier: Web channel bookings almost always have a standardized code or descriptive text indicating an online/web source. Common values include:
- A
Typeattribute set toWEB - A
Codevalue (under a childCompanyNameorChannelCodenode) ofWEB,ONLINE, orINTERNET - A human-readable description like "Web Booking" or "Online Reservation"
- A
Example XML Snippet
Here’s what this might look like in a typical GetReservationRS response:
<GetReservationRS Version="1.0.0"> <Reservation> <ReservationInfo ReservationID="XYZ123"> <BookingChannel Type="WEB"> <CompanyName Code="WEB" Value="Online Web Portal" /> </BookingChannel> <!-- Other reservation details --> </ReservationInfo> </Reservation> </GetReservationRS>
Retrieve Itinerary Service Specific Note
When you get a GetReservationRS from the Retrieve Itinerary service, the structure is identical to a direct GetReservationRS call. The Retrieve Itinerary service simply fetches existing booking details and wraps them in the standard GetReservationRS format—so you can use the exact same channel-checking logic as above. No extra parsing steps are needed here!
Pro Tip
If you’re working with a specific GDS or booking platform, double-check their official schema docs for the exact node names and valid channel codes (some systems might use ONLINE instead of WEB, for example). But the core approach of targeting the booking channel metadata remains the same.
内容的提问来源于stack exchange,提问作者user4944342

