JAX-WS 2.0.1 Client Runtime

This document describes the architecture of client side JAX-WS 2.0.1 runtime.

JAX-WS 2.0.1 Client Sequence Diagram

JAX-WS 2.0.1 Asynchronous Invocation Sequence Diagram

JAX-WS 2.0.1 Dispatch Invocation Sequence Diagram

Message Flow

com.sun.xml.ws.client.WebService provides client view of a Web service. WebService.getPort returns an instance of com.sun.xml.ws.client.EndpointIFInvocationHandler with com.sun.pept.ept.ContactInfoList and com.sun.pept.Delegate initialized. A method invocation on the port, obtained from WebService, invokes com.sun.xml.ws.client.EndpointIFInvocationHandler#invoke. This method then creates a com.sun.pept.ept.MessageInfo and populates the data (parameters specified by the user) and metadata such as RuntimeContext, RequestContext, Message Exchange Pattern into this MessageInfo. This method then invokes com.sun.pept.Delegate#send and returns the response.

The Delegate.send method iterates through the ContactInfoList and picks up the correct com.sun.pept.ept.ContactInfo based upon the binding id of BindingProvider and sets it on the MessageInfo. After the Delegate obtains a specific ContactInfo it uses that ContactInfo to obtain a protocol-specific com.sun.pept.protocol.MessageDispatcher. There will be two types of client-side MessageDispatchers for JAX-WS 2.0.1, com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher and com.sun.xml.ws.protocol.xml.client.XMLMessageDispatcher. The Delegate then invokes com.sun.pept.protocol.MessageDispatcher#send. The MessageDispatcher.send method makes a decision about the synchronous and asynchronous nature of the message exchange pattern and invokes separate methods accordingly.

The MessageDispatcher uses ContactInfo to obtain a com.sun.xml.ws.encoding.soap.client.SOAPXMLEncoder which converts the MessageInfo to com.sun.xml.ws.encoding.soap.internal.InternalMessage. There will be two types of client-side SOAPXMLEncoder for JAX-WS 2.0.1, SOAPXMEncoder for SOAP 1.1 and com.sun.xml.ws.encoding.soap.client.SOAP12XMLEncoder for SOAP 1.2. The MessageDispatcher invokes configured handlers and use the codec to convert the InternalMessage to a SOAPMessage. The metadata from the MessageInfo is classified into MimeHeaders of this SOAPMessage and context information for com.sun.xml.ws.api.server.WSConnection. The SOAPMessge is then written to the output stream of the WSConnection obtained from MessageInfo.

The MessageDispatcher.receive method handles the response. The SOAPMessageDispatcher extracts the SOAPMessage from the input stream of WSConnection and performs the mustUnderstand processing followed by invocation of any handlers. The MessageDispatcher uses ContactInfo to obtain a com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder which converts the SOAPMessage to InternalMessage and then InternalMessage to MessageInfo. There will be two types of client-side SOAPXMLDecoder for JAX-WS 2.0.1, SOAPXMLDencoder for SOAP 1.1 and com.sun.xml.ws.encoding.soap.client.SOAP12XMLDecoder for SOAP 1.2. The response is returned back to the client code via Delegate.

External Interactions

SAAJ API

MessageFactory(binding).createMessage(MimeHeaders, InputStream)

JAXB API

JAX-WS RI uses the JAXB API to marshall/unmarshall user created JAXB objects with user created JAXBContext. Handler, Dispatch in JAX-WS API provide ways for the user to specify his/her own JAXBContext. JAXBTypeSerializer class uses all these methods.

The following two JAXB classes are implemented by JAX-WS to enable/implement MTOM and XOP

JAXB Runtime-API (private contract)

JAX-WS RI uses these private API for serialization/deserialization purposes. This private API is used to serialize/deserialize method parameters at the time of JAXBTypeSerializer class uses all these methods.

Interface Summary
BindingProviderProperties  
ResponseContextReceiver Receives ResponseContext at the end of the message invocation.
 

Class Summary
AsyncInvoker Invokes Tubeline asynchronously for the client's async API(for e.g.: Dispatch#invokeAsync} The concrete classes need to call Stub#processAsync(Packet, RequestContext, CompletionCallback) in run() method.
AsyncResponseImpl<T> Response implementation.
ClientContainer  
ClientSchemaValidationTube Tube that does the schema validation on the client side.
HandlerConfiguration This class holds the handler information on the BindingProvider.
HandlerConfigurator Used by WSServiceDelegate to configure BindingImpl with handlers.
HandlerConfigurator.AnnotationConfigurator Configures handlers from HandlerChain annotation.
HandlerConfigurator.HandlerResolverImpl Configures handlers by calling HandlerResolver.
PortInfo Information about a port.
RequestContext Request context implementation.
ResponseContext Implements "response context" on top of Packet.
ResponseImpl<T> Response implementation.
SCAnnotations Represents parsed WebServiceClient and WebEndpoint annotations on a Service-derived class.
SEIPortInfo PortInfo that has SEIModel.
Stub Base class for stubs, which accept method invocations from client applications and pass the message to a Tube for processing.
WSServiceDelegate Service objects provide the client view of a Web service.
 

Enum Summary
ContentNegotiation Content negotiation enum.
 

Exception Summary
ClientTransportException  
SenderException