src/share/jaxws_classes/com/sun/xml/internal/ws/server/package-info.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 368
0989ad8c0860
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation. Oracle designates this
aoqi@0 8 * particular file as subject to the "Classpath" exception as provided
aoqi@0 9 * by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 *
aoqi@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 * accompanied this code).
aoqi@0 16 *
aoqi@0 17 * You should have received a copy of the GNU General Public License version
aoqi@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 *
aoqi@0 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 * or visit www.oracle.com if you need additional information or have any
aoqi@0 23 * questions.
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 /**
aoqi@0 27 * <h1>JAX-WS 2.0.1 Server Runtime</h1>
aoqi@0 28 * <P>This document describes the architecture of server side
aoqi@0 29 * JAX-WS 2.0.1 runtime. </p>
aoqi@0 30 *
aoqi@0 31 * <h3>JAX-WS 2.0.1 Server Runtime Sequence Diagram</h3>
aoqi@0 32
aoqi@0 33 * <img src='../../../../../jaxws/basic-server.seq.png'>
aoqi@0 34
aoqi@0 35 *
aoqi@0 36 *
aoqi@0 37 * <H3>Message Flow</H3>
aoqi@0 38 * <P>A Web Service invocation starts with either the
aoqi@0 39 * {@link com.sun.xml.internal.ws.transport.http.servlet.WSServletDelegate WSServletDelegate}
aoqi@0 40 * or the {@link com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl ServerConnectionImpl}.
aoqi@0 41 * Both of these classes find the appropriate {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo RuntimeEndpointInfo}
aoqi@0 42 * and invokes the {@link com.sun.xml.internal.ws.server.Tie#handle(com.sun.xml.internal.ws.api.server.WSConnection,
aoqi@0 43 * com.sun.xml.internal.ws.spi.runtime.RuntimeEndpointInfo) Tie.handle}
aoqi@0 44 * method. This method first creates a {@link com.sun.pept.ept.MessageInfo MessageInfo}
aoqi@0 45 * used to gather inforrmation about the message to be received. A
aoqi@0 46 * {@link com.sun.xml.internal.ws.server.RuntimeContext RuntimeContext}
aoqi@0 47 * is then created with the MessageInfo and the {@link com.sun.xml.internal.ws.api.model.SEIModel RuntimeModel}
aoqi@0 48 * retrieved from the RuntimeEndpointInfo. The RuntimeContext is then
aoqi@0 49 * stored in the MessageInfo. The {@link com.sun.pept.ept.EPTFactory EPTFactory}
aoqi@0 50 * is retrieved from the {@link com.sun.xml.internal.ws.server.EPTFactoryFactoryBase EPTFactoryFactoryBase}
aoqi@0 51 * and also placed in the MessagInfo. A {@link com.sun.pept.protocol.MessageDispatcher MessageDispatcher}
aoqi@0 52 * is then created and the receive method is invoked. There will be two
aoqi@0 53 * types of MessageDispatchers for JAX-WS 2.0.1, SOAPMessageDispatcher
aoqi@0 54 * (one for client and one for the server) and an XMLMessageDispatcher
aoqi@0 55 * (one for the client and one for the server).</P>
aoqi@0 56 * <P>The MessageDispatcher.receive method orchestrates the receiving of
aoqi@0 57 * a Message. The SOAPMessageDispatcher first converts the MessageInfo
aoqi@0 58 * to a SOAPMessage. The SOAPMessageDispatcher then does mustUnderstand
aoqi@0 59 * processing followed by an invocation of any handlers. The SOAPMessage
aoqi@0 60 * is then converted to an InternalMessage and stored in the
aoqi@0 61 * MessageInfo. The converting of the SOAPMessage to an InternalMessage
aoqi@0 62 * is done using the decoder retrieved from the EPTFactory that is
aoqi@0 63 * contained in the MessageInfo. Once the SOAPMessage has been converted
aoqi@0 64 * to an InternalMessage the endpoint implementation is invoked via
aoqi@0 65 * reflection from the Method stored in the MessageInfo. The return
aoqi@0 66 * value of the method call is then stored in the InternalMessage. An
aoqi@0 67 * internalMessage is then created from the MessageInfo. The SOAPEncoder
aoqi@0 68 * is retrieved from the EPTFactory stored in the MessageInfo. The
aoqi@0 69 * SOAPEncoder.toSOAPMessage is then invoked to create a SOAPMessage
aoqi@0 70 * from the InternalMessage. A WSConnection is then retrieved from the
aoqi@0 71 * MessageInfo and the SOAPMessage is returned over that WSConnection.</P>
aoqi@0 72 * <P><BR>
aoqi@0 73 * </P>
aoqi@0 74 * <H3>External Interactions</H3>
aoqi@0 75 * <H4>SAAJ API</H4>
aoqi@0 76 * <UL>
aoqi@0 77 * <LI><P>JAX-WS creates SAAJ javax.xml.soap.SOAPMessage
aoqi@0 78 * from the HttpServletRequest.
aoqi@0 79 * At present, JAX-WS reads all the bytes from the request stream and
aoqi@0 80 * then creates SOAPMessage along with the HTTP headers.</P>
aoqi@0 81 * </UL>
aoqi@0 82 * <P>javax.xml.soap.MessageFactory(binding).createMessage(MimeHeaders, InputStream)</P>
aoqi@0 83 * <UL>
aoqi@0 84 * <LI><P>SOAPMessage parses the content from the stream including MIME
aoqi@0 85 * data</P>
aoqi@0 86 * <LI><P>com.sun.xml.internal.ws.server.SOAPMessageDispatcher::checkHeadersPeekBody()</P>
aoqi@0 87 * <P>SOAPMessage.getSOAPHeader() is used for mustUnderstand processing
aoqi@0 88 * of headers. It further uses
aoqi@0 89 * javax.xml.soap.SOAPHeader.examineMustUnderstandHeaderElements(role)</P>
aoqi@0 90 * <P>SOAPMessage.getSOAPBody().getFistChild() is used for guessing the
aoqi@0 91 * MEP of the request</P>
aoqi@0 92 * <LI><P>com.sun.xml.internal.ws.handler.HandlerChainCaller:insertFaultMessage()</P>
aoqi@0 93 * <P>SOAPMessage.getSOAPPart().getEnvelope() and some other SAAJ calls
aoqi@0 94 * are made to create a fault in the SOAPMessage</P>
aoqi@0 95 * <LI><P>com.sun.xml.internal.ws.handler.LogicalMessageImpl::getPayload()
aoqi@0 96 * interacts with SAAJ to get body from SOAPMessage</P>
aoqi@0 97 * <LI><P>com.sun.xml.internal.ws.encoding.soap.SOAPEncoder.toSOAPMessage(com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage,
aoqi@0 98 * SOAPMessage). There is a scenario where there is SOAPMessage and a
aoqi@0 99 * logical handler sets payload as Source. To write to the stream,
aoqi@0 100 * SOAPMessage.writeTo() is used but before that the body needs to be
aoqi@0 101 * updated with logical handler' Source. Need to verify if this
aoqi@0 102 * scenario is still happening since Handler.close() is changed to take
aoqi@0 103 * MessageContext.</P>
aoqi@0 104 * <LI><P>com.sun.xml.internal.ws.handlerSOAPMessageContextImpl.getHeaders()
aoqi@0 105 * uses SAAJ API to get headers.</P>
aoqi@0 106 * <LI><P>SOAPMessage.writeTo() is used to write response. At present,
aoqi@0 107 * it writes into byte[] and this byte[] is written to
aoqi@0 108 * HttpServletResponse.</P>
aoqi@0 109 * </UL>
aoqi@0 110 * <H4>JAXB API</H4>
aoqi@0 111 * <P>JAX-WS RI uses the JAXB API to marshall/unmarshall user created
aoqi@0 112 * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}.
aoqi@0 113 * Handler, Dispatch in JAX-WS API provide ways for the user to specify his/her own
aoqi@0 114 * JAXBContext. {@link com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer JAXBTypeSerializer} class uses all these methods.</P>
aoqi@0 115 * <UL>
aoqi@0 116 * <LI><p>{@link javax.xml.bind.Marshaller#marshal(Object,XMLStreamWriter) Marshaller.marshal(Object,XMLStreamWriter)}</p>
aoqi@0 117 * <LI><P>{@link javax.xml.bind.Marshaller#marshal(Object,Result) Marshaller.marshal(Object, DomResult)}</P>
aoqi@0 118 * <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(XMLStreamReader) Object Unmarshaller.unmarshal(XMLStreamReader)}</P>
aoqi@0 119 * <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(Source) Object Unmarshaller.unmarshal(Source)}</P>
aoqi@0 120 * </UL>
aoqi@0 121 * The following two JAXB classes are implemented by JAX-WS to enable/implement MTOM and XOP
aoqi@0 122 * <UL>
aoqi@0 123 * <LI><P>{@link javax.xml.bind.attachment.AttachmentMarshaller AttachmentMarshaller}</P>
aoqi@0 124 * <LI><P>{@link javax.xml.bind.attachment.AttachmentUnmarshaller AttachmentUnmarshaller}</P>
aoqi@0 125 * </UL>
aoqi@0 126 * <H4>JAXB Runtime-API (private contract)</H4>
aoqi@0 127 * <P>JAX-WS RI uses these private API for serialization/deserialization
aoqi@0 128 * purposes. This private API is used to serialize/deserialize method
aoqi@0 129 * parameters at the time of JAXBTypeSerializer class uses all
aoqi@0 130 * these methods.</P>
aoqi@0 131 * <UL>
aoqi@0 132 * <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, XMLStreamWriter) Bridge.marshal(BridgeContext, Object, XMLStreamWriter)}</P>
aoqi@0 133 * <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, Node) Bridge.marshal(BridgeContext, Object, Node)}</P>
aoqi@0 134 * <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#unmarshal(BridgeContext, XMLStreamReader) Object Bridge.unmarshal(BridgeContext, XMLStreamReader)}</P>
aoqi@0 135 * </UL>
aoqi@0 136 *
aoqi@0 137 * @ArchitectureDocument
aoqi@0 138 **/
aoqi@0 139 package com.sun.xml.internal.ws.server;
aoqi@0 140
aoqi@0 141 import com.sun.xml.internal.bind.api.BridgeContext;
aoqi@0 142
aoqi@0 143 import javax.xml.stream.XMLStreamReader;
aoqi@0 144 import javax.xml.stream.XMLStreamWriter;
aoqi@0 145 import javax.xml.transform.Source;
aoqi@0 146 import javax.xml.transform.Result;
aoqi@0 147
aoqi@0 148 import org.w3c.dom.Node;

mercurial