ohair@286: /* alanb@368: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. ohair@286: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ohair@286: * ohair@286: * This code is free software; you can redistribute it and/or modify it ohair@286: * under the terms of the GNU General Public License version 2 only, as ohair@286: * published by the Free Software Foundation. Oracle designates this ohair@286: * particular file as subject to the "Classpath" exception as provided ohair@286: * by Oracle in the LICENSE file that accompanied this code. ohair@286: * ohair@286: * This code is distributed in the hope that it will be useful, but WITHOUT ohair@286: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ohair@286: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ohair@286: * version 2 for more details (a copy is included in the LICENSE file that ohair@286: * accompanied this code). ohair@286: * ohair@286: * You should have received a copy of the GNU General Public License version ohair@286: * 2 along with this work; if not, write to the Free Software Foundation, ohair@286: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ohair@286: * ohair@286: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@286: * or visit www.oracle.com if you need additional information or have any ohair@286: * questions. ohair@286: */ ohair@286: ohair@286: /** ohair@286: *

JAX-WS 2.0.1 Server Runtime

ohair@286: *

This document describes the architecture of server side ohair@286: * JAX-WS 2.0.1 runtime.

ohair@286: * ohair@286: *

JAX-WS 2.0.1 Server Runtime Sequence Diagram

ohair@286: ohair@286: * ohair@286: ohair@286: * ohair@286: * ohair@286: *

Message Flow

ohair@286: *

A Web Service invocation starts with either the ohair@286: * {@link com.sun.xml.internal.ws.transport.http.servlet.WSServletDelegate WSServletDelegate} ohair@286: * or the {@link com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl ServerConnectionImpl}. ohair@286: * Both of these classes find the appropriate {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo RuntimeEndpointInfo} ohair@286: * and invokes the {@link com.sun.xml.internal.ws.server.Tie#handle(com.sun.xml.internal.ws.api.server.WSConnection, ohair@286: * com.sun.xml.internal.ws.spi.runtime.RuntimeEndpointInfo) Tie.handle} ohair@286: * method. This method first creates a {@link com.sun.pept.ept.MessageInfo MessageInfo} ohair@286: * used to gather inforrmation about the message to be received. A ohair@286: * {@link com.sun.xml.internal.ws.server.RuntimeContext RuntimeContext} ohair@286: * is then created with the MessageInfo and the {@link com.sun.xml.internal.ws.api.model.SEIModel RuntimeModel} ohair@286: * retrieved from the RuntimeEndpointInfo. The RuntimeContext is then ohair@286: * stored in the MessageInfo. The {@link com.sun.pept.ept.EPTFactory EPTFactory} ohair@286: * is retrieved from the {@link com.sun.xml.internal.ws.server.EPTFactoryFactoryBase EPTFactoryFactoryBase} ohair@286: * and also placed in the MessagInfo. A {@link com.sun.pept.protocol.MessageDispatcher MessageDispatcher} ohair@286: * is then created and the receive method is invoked. There will be two ohair@286: * types of MessageDispatchers for JAX-WS 2.0.1, SOAPMessageDispatcher ohair@286: * (one for client and one for the server) and an XMLMessageDispatcher ohair@286: * (one for the client and one for the server).

ohair@286: *

The MessageDispatcher.receive method orchestrates the receiving of ohair@286: * a Message. The SOAPMessageDispatcher first converts the MessageInfo ohair@286: * to a SOAPMessage. The SOAPMessageDispatcher then does mustUnderstand ohair@286: * processing followed by an invocation of any handlers. The SOAPMessage ohair@286: * is then converted to an InternalMessage and stored in the ohair@286: * MessageInfo. The converting of the SOAPMessage to an InternalMessage ohair@286: * is done using the decoder retrieved from the EPTFactory that is ohair@286: * contained in the MessageInfo. Once the SOAPMessage has been converted ohair@286: * to an InternalMessage the endpoint implementation is invoked via ohair@286: * reflection from the Method stored in the MessageInfo. The return ohair@286: * value of the method call is then stored in the InternalMessage. An ohair@286: * internalMessage is then created from the MessageInfo. The SOAPEncoder ohair@286: * is retrieved from the EPTFactory stored in the MessageInfo. The ohair@286: * SOAPEncoder.toSOAPMessage is then invoked to create a SOAPMessage ohair@286: * from the InternalMessage. A WSConnection is then retrieved from the ohair@286: * MessageInfo and the SOAPMessage is returned over that WSConnection.

ohair@286: *


ohair@286: *

ohair@286: *

External Interactions

ohair@286: *

SAAJ API

ohair@286: * ohair@286: *

javax.xml.soap.MessageFactory(binding).createMessage(MimeHeaders, InputStream)

ohair@286: * ohair@286: *

JAXB API

ohair@286: *

JAX-WS RI uses the JAXB API to marshall/unmarshall user created ohair@286: * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}. ohair@286: * Handler, Dispatch in JAX-WS API provide ways for the user to specify his/her own ohair@286: * JAXBContext. {@link com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer JAXBTypeSerializer} class uses all these methods.

ohair@286: * ohair@286: * The following two JAXB classes are implemented by JAX-WS to enable/implement MTOM and XOP ohair@286: * ohair@286: *

JAXB Runtime-API (private contract)

ohair@286: *

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

ohair@286: * ohair@286: * ohair@286: * @ArchitectureDocument ohair@286: **/ ohair@286: package com.sun.xml.internal.ws.server; ohair@286: ohair@286: import com.sun.xml.internal.bind.api.BridgeContext; ohair@286: ohair@286: import javax.xml.stream.XMLStreamReader; ohair@286: import javax.xml.stream.XMLStreamWriter; ohair@286: import javax.xml.transform.Source; ohair@286: import javax.xml.transform.Result; ohair@286: ohair@286: import org.w3c.dom.Node;