98
Designing a Service's Interaction Layer
One question remains: How does the client get the final result of its request?
The service may make the result of the client's request available in one of two
ways:
The client that invoked the service periodically checks the status of the request
using the correlation identifier that was provided at the time the request was
submitted. This is also known as polling, and it appears as Option 1 in Figure
3.8.
Or, if the client itself is a Web service peer, the service calls back the client's
service with the result. The client may use the correlation identifier to relate the
response with the original request (Option 2 in Figure 3.8).
Often this is decided by the nature of the service itself. For example, if the
service runs a business process workflow, the workflow requires the service to
take appropriate action after processing the request.
3.4.4 Formulating Responses
After you delegate the request to the business logic portion of the application, and
the business logic completes its processing, you are ready for the next step: to form
the response to the request.
E
You should perform response generation, which is simply constructing the
method call return values and output parameters, on the interaction layer, as
close as possible to the service endpoint.
This permits having a common location for response assembly and XML doc
ument transformations, particularly if the document you return to the caller must
conform to a different schema from the internal schema. Keeping this functional
ity near the endpoint lets you implement data caching and avoid extra trips to the
processing layer. (See Figure 3.9.).
Consider response generation from the weather information service's point
of view. The weather information service may be used by a variety of client types,
from browsers to rich clients to handheld devices. A well designed weather infor
mation service would render its responses in formats suitable for these different
client types.
footer
Our web partners:
Inexpensive
Web Hosting
Java Web Hosting
personal webspace
webspace php
linux webhost
html web templates
DreamweaverQuality Web Templates
PSD Web Templates
cheap webhost
j2ee web Hosting
buy webspace
ftp webspace
adult webspace
frontpage WebHosting
webspace hosting
cheap webhost
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved
webhosting