Let us take a very simple scenario whereby a travel agency system contacts an airlines reservation system in order to complete a travel transaction request. The two applications—the Travel Agency Web service and the Airlines Web service, respectively—use XML to exchange travel itinerary information and payment details, using a well-understood industry-standard specification. The industry specification states that when making reservations, the applications always mark them with the makeReservation tag.
The Fabrikam456 Travel Agency Company's application is designed to accept a reservation request with a makeReservation tag from a customer. Based on the airline details requested, the application will contact the airline's reservation service. The Airlines456 Company's application is designed to perform a transaction under which a reservation for the passenger is made and charged to the credit card system. Note that the airline can even contact the credit card company's charging service in order to perform that operation.
A user surfs for the best-possible travel deal and decides to purchase the ticket from the Fabrikam456 Travel Agency Company. The user submits a request to access the agency's reservation Web service by specifying the itinerary and credit card details in a SOAP message marked with a makeReservation tag. The agency application requests a reservation to be made to the airline reservation system by sending in a booking request from the agency, providing both the agency's details and the passenger's details. When the airline system receives the booking request, the application looks in the database for the availability of seats for that particular itinerary. Using XML, the airline application will return a response after making the reservation in its back-end system. The response marks the details with record-locator number and fare basic code details, using the recordLocator tag, as shown next:
When the travel agency receives the message from the airline, the application scans it for the recordLocator tag. On finding it, the application passes the data into its system to issue a ticket to the end user.
The Web service that provides the reservation service in a service network can be combined with other Web services, such as a weather Web service to obtain the weather forecast for the travel destination, and a credit Web service to charge the end user for the travel expense. This way, Fabrikam456 Travel Agency Company can automatically issue tickets and schedule ticket delivery with shipping companies through the Fabrikam456 Web service.
This example describes a simple Web service in which two or more functions cooperate through the Web, and the nature of their cooperation adapts to parameters provided by a particular request. As you can see, Web Services technology provides a framework for loosely coupled, or dynamic, application integration.