Java Reference
In-Depth Information
A brief look at the JAX WS architecture
When a SOAP message sent by the client enters the web service runtime environment, it is
captured by a component named server endpoint listener , which, in turn, uses the Dis-
patcher module to deliver the SOAP message to that service.
At this point, the HTTP request is converted internally into a SOAP message. The message
content is extracted from the transport protocol and processed through the handler chain
configured for the web service.
SOAP message handlers are used to intercept SOAP messages as they make their way from
the client to the endpoint service and vice versa. These handlers intercept SOAP messages
for both the request and response of the web service.
The next step is unmarshalling the SOAP message into Java objects. This process is gov-
erned by WSDL to Java Mapping and XML to Java Mapping. The former is performed by
the JAX-WS engine, and it determines which endpoint to invoke from the SOAP message.
The latter, performed by the JAXB libraries, deserializes the SOAP message so that it is
ready to invoke the endpoint method.
Finally, the deserialized SOAP message reaches the actual web service implementation and
the method is invoked.
Once the call is completed, the process is reversed. The return value from the web service
method is marshalled into a SOAP response message using JAX-WS WSDL to Java map-
ping and JAXB 2.0 XML to Java mapping.
Note
The JAXB provides a fast and convenient way to bind XML schemas and Java representa-
tions, making it easy for Java developers to incorporate XML data and process functions in
Java applications. As part of this process, JAXB provides methods to unmarshal XML in-
stance documents into Java content trees, and then marshal Java content trees back into
XML instance documents. JAXB also provides a way to generate XML schema from Java
objects.
Next, the outbound message is processed by handlers before returning it to the dispatcher
and endpoint listener that will transmit the message as an HTTP response.
Search WWH ::




Custom Search