![]() |
Sun ONE Web Services Platform Developer Edition Developer's Guide |
Dining Guide Sample ApplicationThis section is an overview of a Sun ONE Studio tutorial sample application demonstrating its capabilities to develop and deploy Web services using SOAP on the Sun ONE Application Server.
Overview
The tutorial application, DiningGuide, is a simple dining guide application that enables users to:
- View a list of available restaurants.
- View restaurant features such as:
Rating number (1 to 5)
- View the list of a selected restaurant's customer reviews.
- Add a review to a restaurant's record.
The architecture of the sample application is illustrated in the following figure.
   Dining Guide Sample Application Architecture
![]()
The heart of the tutorial application is the EJB tier that contains:
- Two entity type enterprise beans.
- Two detail classes.
- A session bean.
The entity beans represent the two Dining Guide database tables:
- Restaurant
- CustomerReview
The two detail classes mirror the entity bean fields and include getter and setter methods for each field. The detail classes are used to reduce the number of method calls to the entity beans when retrieving database data. The session bean manages the interaction between the client (by way of the Web service) and the entity beans.
The client includes a client proxy, which uses the SOAP runtime system to communicate with the SOAP runtime system on the Web server. Requests are passed as SOAP messages. The Web service translates the SOAP messages into calls on the EJB tier's session bean's methods. The session bean passes its responses back to the Web service, which translates them into SOAP messages to give to the client proxy, and ultimately get translated into a display of data or action.
A SOAP request is an XML wrapper that contains a method call on the Web service and input data in serialized form.
The Sun ONE Studio is used as the development platform, and is deployed on the Sun ONE Application Server. Web services, using SOAP is demonstrated.