Java Reference
In-Depth Information
A consumer, when ready, invokes a SOAP engine on the client side to begin a SOAP
call across the network. In this scenario, the consumer understands the SOAP message
fully and constructs a SOAP message using SOAP with Attachment API for Java (SAAJ).
Once a SOAP message is formed, the SOAP engine sends the message to the remote server
via HTTP. After successfully receiving the message, the server processes the request by
invoking the appropriate business or data services in the backend. In this case, the getEm-
ployee method of the employees service is invoked. Before the data access layer is called,
additional business logic processing can be done in this class to manipulate the data. Em-
ployeeDAO is a component that interacts directly with the database using JDBC for data
processing. The data source may not always be a relational database.
Once the processing is completed, the employees service, with the help of the WS package,
forms a SOAP message and returns to the SOAP engine on the server side. As a part of
the request-response message exchange pattern, the response is then returned to the SOAP
engine on the client side. Once the client SOAP engine successfully receives the message,
it returns to the Service Consumer for final processing.
The process of forming a SOAP message is often called 'marshalling. Conversely, the process
of decoding
a SOAP message into a
native form for further
processing is called
'unmarshalling'
.
This sequence diagram shows an example of a synchronous message exchange. In other
words, activities in this diagram occur in sequence. In some cases, the processing may take
a long time, and the server may return immediately before the processing completes. This
is a form of asynchronous message exchange. When the server has completed processing
the request, it may initiate a call to the client to return the response with the actual data or
simply a notification. The client can also periodically poll the server for data. The second
option suffers two problems. If the timing window between two polls is too large, the delay
can be significant. If it is small, it wastes valuable processing power on both sides.
4.1.3 Deployment Diagram
The simple deployment of this WS application is depicted as follows:
Search WWH ::




Custom Search