Chapter 3 Service Endpoint Design
91
mas, and mapping documents to domain objects be performed as close to the
service endpoint as possible, and certainly in the service interaction layer.
A design such as this helps to catch errors early, and thus avoids unnecessary
calls and round trips to the processing layer. Figure 3.4 shows the recommended
way to handle requests and responses in the Web service's interaction layer.
The Web service's interaction layer handles all incoming requests and dele
gates them to the business logic exposed in the processing layer. When imple
mented in this manner, the Web service interaction layer has several advantages,
since it gives you a common location for the following tasks:
Managing the handling of requests so that the service endpoint serves as the
initial point of contact
Invoking security services, including authentication and authorization
Validating and transforming incoming XML documents and mapping XML
documents to domain objects
Service Interaction Layer
Service Processing Layer
Web Service Endpoint
XML Document
er
Preprocessing
Validation
ng
Transformation
aramet P essi
Deassembling
est
rocP
Java type input parameter
Web
equR
Service
Clients
XML Document
eter
Postprocessing
Transformation
aram
Caching
Assembling
rocessingP
esponse P
Java type output parameter
R
Figure 3.4
Web Service Request Processing
<
New Page 1
Web Hosting Apache