Exercises


The following exercises help you use the knowledge you gained in this chapter to create a new Web service that offers a seat reservation system for a cinema.

  1. Create a new Web service named CinemaReservation.

  2. The ReserveSeatRequest and ReserveSeatResponse classes are needed to define the data sent to and from the Web service. the ReserveSeatRequest class needs a member Name of type string to send a name and two members of type int to send a request for a seat defined with Row and Seat. The class ReserveSeatResponse defines the data to be sent back to the client — that is, the name for the reservation and the seat that is really reserved.

  3. Create a Web method ReserveSeat that requires a ReserveSeatRequest as a parameter and returns a ReserveSeatResponse. Within the implementation of the Web service, you can use a Cache object (see Chapter 18) to remember the seats that already have been reserved. If the seat that is requested is available, return the seat and reserve it in the Cache object. If it is not available, take the next free seat. For the seats in the Cache object you can use a two-dimensional array, as was shown in Chapter 5.

  4. Create a Windows client application that uses the Web service to reserve a seat in the cinema.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net