Let:
A SOAP-based service A: a flight reservation service that handles the flight searching and reservation requests.
A REST based service B: a flight filtering service that checks flight availability based on departure and arrival airports, departure and return dates, number of passengers and flight class, and update flight availability based on incoming reservations (First, Business or Economy) (see the figure below)
Each flight has information about: departure and return dates, departure and destination airports, available places (First, Business and Economy).
A customer (client) sends a request to service A to check flights that are available. When service A receives the client request, it will call service B to filter only flights that are matched to client request.
Input: flight departure and destination, flight dates (departure and return), number of passengers, flight class (First, business or Economy) ; Output: list of available flights (Flight ID and related information) that matched the user's request or “No available flight.”
Based on the list of available flights, the client can make a reservation by providing a flight ID. After receiving a flight ID, service A will request service B to update the reservation information. If the reservation is successful, service B will return to A a value “true”. Otherwise (for example, the ID is not corresponding to an available flight) it returns a value “false”.
If A receives a “true”, it will return the client a message: “Reservation successful”. Otherwise, it will returns a message: “Reservation error or the flight”+ID+“ is not available”.
If the client make another search, the service B should return the results with the updated information about the previous reservation.