Running the Airline Reservations sample

You can run the Airline Reservations sample to simulate the following tasks:

For each task, you put a message on a particular WebSphere MQ queue. The appropriate message flow gets the message from the queue and processes the message. The following instructions describe how to put the supplied self-defining XML messages through the Airline Reservations sample message flows and what output you can expect to receive from the message flows. Because the message flows update databases, you must run the message flows in the order that they are listed in the following instructions.

When you run the sample, you may see error messages similar to Unresolvable database table reference T.CLASSTYPE in the Problems view of the IBM Integration Toolkit. This warning indicates that definitions for the database tables have not been imported into the project. This warning does not affect the behavior of the sample at run time.

How you view the sample database contents depends on which database product is installed. For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the IBM Integration Bus documentation.

Note: Running multiple test messages through the flow might result in an apparent failure. This apparent failure is caused because a threshold has been passed, causing the message to pass through the flow differently. To resolve this apparent failure, revert the database to the original content.

Running the XML_Reservation message flow

The XML_Reservation message flow reserves seats on the flight listed in the input message and generates reply messages for the passengers to confirm their reservations.

To run the XML_Reservation message flow:

  1. In the "Application Development" view, expand the Airline XML Message Flows project, under Flow Tests double-click the reservation1.mbtest file to open it in the Test Client.
  2. In the Test Client, click Enqueue.
  3. Click Send Message. The first input message is put on the XML_RESERVATION_IN queue.
  4. In the Test Client, click Dequeue.
  5. Click Get Message to read the first message from the queue, confirming the booking for Mary Smith. The reply message confirms the reservation for one passenger and contains the full name of the passenger, the class of seat they have reserved, and their unique reservation number. The following example shows the format of a reply message:
    <PassengerReservationResponse>
    <ListOfConfirmations>
    <Confirmation>
    <FirstName>Mary</FirstName>
    <LastName>Smith</LastName>
    <Class>F</Class>
    <ReservationNumber>CA937200305251</ReservationNumber>
    </Confirmation>
    </ListOfConfirmations>
    </PassengerReservationResponse>
  6. Repeat the previous step to get each of the remaining three messages, confirming the bookings for Diane Rose, Debra Wiess, and Atila Wiess, from the XML_RESERVATION_OUT queue.
  7. Check the XMLFLIGHTTB table in the RESERVDB database. In all the rows, the value in the RESERVATIONSEQNO field has increased by four. In the row for flight CA937 on May 25th 2003 the XML_Reservation message flow has made the following changes:
  8. Check the XMLPASSENGERTB table in the RESERVDB database. The XML_Reservation message flow has made the following changes:
  9. Open reservation2.mbtest in the Test Client, click Enqueue.
  10. Click Send Message to put the second input message on the XML_RESERVATION_IN queue.
  11. In the Test Client, click Dequeue.
  12. Click Get Message to get one reply message from the XML_RESERVATION_OUT queue.
    The reply message confirms the second reservation for Mary Smith, and contains her full name, the class of seat she has reserved, and her unique reservation number. The structure of the reply message is the same as for the replies to the first input message.
  13. Check the XMLFLIGHTTB table in the RESERVDB database. In all the rows, the value in the RESERVATIONSEQNO has increased by one. In the row for flight BA039 on May 25th 2003 the XML_Reservation message flow has made the following changes:
  14. Check the XMLPASSENGERTB table in the RESERVDB database. The XML_RESERVATION message flow has made the following changes:

Running the XML_PassengerQuery message flow

The XML_PassengerQuery message flow retrieves the reservation details of the passenger specified in the input message. The type of information in the output message depends on the information that is given in the input message.

To run the XML_PassengerQuery message flow:

  1. Open passengerquery1.mbtest in the Test Client, click Enqueue.
  2. Click Send Message. The first input message is put on the XML_PASSENGERQUERY_IN queue.
  3. In the Test Client, click Dequeue.
  4. Click Get Message to get one output message from the XML_PASSENGERQUERY_OUT queue. The output message contains the name and reservation details of Debra Weiss, who was allocated the reservation number that is specified in the input message. The following example shows the format of the output message:
    <PassengerInfoResponse>
       <PassengerInfo>
          <ReservationNumber>CA937200305253</ReservationNumber>
          <FirstName>Debra</FirstName>
          <LastName>Weiss</LastName>
          <FlightNumber>CA937</FlightNumber>
          <Date>20030525</Date>
          <Class>Y</Class>
       </PassengerInfo>
    <PassengerInfoResponse>
  5. Open passengerquery2.mbtest in the Test Client, click Enqueue.
  6. Click Send Message to put the second input message on the XML_PASSENGERQUERY_IN queue.
  7. In the Test Client, click Dequeue.
  8. Click Get Message to get one output message from the XML_PASSENGERQUERY_OUT queue. The output message contains the name and reservation details of both reservations made by Mary Smith, the passenger specified in the input message. The following example shows the format of the output message:
    <PassengerInfoResponse>
       <ListOfReservations>
          <Reservation>
             <FlightNumber>CA937</FlightNumber>
             <Date>20030525</Date>
             <Class>F</Class>
          </Reservation>
          <Reservation>
             <FlightNumber>BA039</FlightNumber>
             <Date>20030525</Date>
             <Class>F</Class>
          </Reservation>
       </ListOfReservations>
    </PassengerInfoResponse>
  9. Check the RESERVDB database to see that the XML_PassengerQuery message flow has not modified any of the data.

Running the XML_FlightQuery message flows

The XML_FlightQuery message flow is constructed from three small message flows. All three message flows must be deployed to the integration node and started for XML_FlightQuery to work:

The XML_FlightQuery message flow retrieves information about the flight that is specified in the input message, and a list of passengers who have booked reservations on that flight.

To run the XML_FlightQuery message flow:

  1. Open flightdetailsquery.mbtest in the Test Client, click Enqueue.
  2. Click Send Message to put the input message on the XML_FLIGHTQUERY_IN queue.
  3. In the Test Client, click Dequeue.
  4. Click Get Message to get one output message from the XML_FLIGHTQUERY_OUT queue. The reply message contains the details of how many seats there are in First Class and Economy Class, the cost of the seats, and how many seats are available. The following example shows the format of the reply message:
    <FlightDetailsInfoResponse>
    <Flight number="CA937" Flightdate="20030525">
    <FirstClass>
    <Capacity>48</Capacity>
    <Used>2</Used>
    <Price>300</Price>
    </FirstClass>
    <EconomyClass>
    <Capacity>198</Capacity>
    <Used>2</Used>
    <Price>200</Price>
    </EconomyClass>
    <Origin>BEIJING</Origin>
    <Destination>LONDON</Destination>
    </Flight>
    <ListOfPassengers>
    <Passenger>
    <ReservationNumber>CA937200305251</ReservationNumber>
    <FirstName>Mary</FirstName>
    <LastName>Smith</LastName>
    <Class>F</Class>
    </Passenger>
    <Passenger>
    <ReservationNumber>CA937200305252</ReservationNumber>
    <FirstName>Diane</FirstName>
    <LastName>Rose</LastName>
    <Class>Y</Class>
    </Passenger>
    <Passenger>
    <ReservationNumber>CA937200305253</ReservationNumber>
    <FirstName>Debra</FirstName>
    <LastName>Wiess</LastName>
    <Class>Y</Class>
    </Passenger>
    <Passenger>
    <ReservationNumber>CA937200305254</ReservationNumber>
    <FirstName>Atila</FirstName>
    <LastName>Wiess</LastName>
    <Class>F</Class>
    </Passenger>
    </ListOfPassengers>
    </FlightDetailsInfoResponse>
  5. Check the RESERVDB database to see that the XML_FlightQuery message flow has not modified any of the data.

Running the XML_CancelReservation message flow

The XML_CancelReservation message flow cancels the reservations that are listed, by their reservation number, in the input message.

To run the XML_CancelReservation message flow:

  1. Open cancelreservation.mbtest in the Test Client, click Enqueue.
  2. Check the RESERVDB user database to ensure that the reservation numbers in cancelreservation.mbtest exist in the XMLPASSENGERTB table. If the reservation numbers do not exist in cancelreservation.mbtest, edit the Message data field.
  3. Click Send Message. The input message is put on the XML_CANCELRESERVATION_IN queue.
  4. In the Test Client, click Dequeue.
  5. Click Get Message to get one output message from the XML_CANCELRESERVATION_OUT queue. The output message is a copy of the input message.
  6. Check the XMLFLIGHTTB table in the RESERVDB database. In the row for flight CA937 on May 25th 2003, the XML_CancelReservation message flow has made the following changes:
  7. Check the XMLPASSENGERTB table in the RESERVDB database. The XML_CancelReservation message flow has made the following changes:

Back to sample home