Package com.sun.xml.ws.transport.http
Class HttpAdapter
java.lang.Object
com.sun.xml.ws.api.server.Adapter<com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit>
com.sun.xml.ws.transport.http.HttpAdapter
- All Implemented Interfaces:
Component,Reconfigurable
- Direct Known Subclasses:
ServerAdapter,ServletAdapter
Adapter that receives messages in HTTP.
This object also assigns unique query string (such as "xsd=1") to
each SDDocument so that they can be served by HTTP GET requests.
- Author:
- Kohsuke Kawaguchi, Jitendra Kotamraju
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.sun.xml.ws.api.server.Adapter
Adapter.Toolkit -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic booleanDumps what goes across HTTP transport.static intstatic final HttpAdapter.CompletionCallbackfinal HttpAdapterList<? extends HttpAdapter>static booleanprotected booleanfinal StringServlet URL pattern with which thisHttpAdapteris associated.protected Map<String,SDDocument> SDDocuments keyed by the query string like "?abc". -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner) Deprecated.remove as soon as we can update the test util.protectedHttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner, String urlPattern) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSatellites(Packet packet) static HttpAdaptercreateAlone(WSEndpoint endpoint) Creates a loneHttpAdapterthat does not know of any otherHttpAdapters.protected com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkitCreates aAdapter<TK extends Adapter.Toolkit>.Toolkitinstance.static StringfixQuotesAroundSoapAction(String soapAction) Some stacks may send non WS-I BP 1.2 conforming SoapAction.getDocumentAddressResolver(PortAddressResolver portAddressResolver) protected NonAnonymousResponseProcessorgetPortAddressResolver(String baseAddress) Return the last known service definition of the endpoint.Returns the "/abc/def/ghi" portion if the URL pattern is "/abc/def/ghi/*".voidhandle(WSHTTPConnection connection) Receives the incoming HTTP connection and dispatches it to JAX-WS.booleanhandleGet(WSHTTPConnection connection) final voidinitWSDLMap(ServiceDefinition serviceDefinition) Fill in WSDL map.voidvoidinvokeAsync(WSHTTPConnection con, HttpAdapter.CompletionCallback callback) voidSends out the WSDL (and other referenced documents) in response to the GET requests to URLs like "?wsdl" or "?xsd=2".static voidsetDump(boolean dumpMessages) static voidsetDumpTreshold(int treshold) static voidsetPublishStatus(boolean publish) protected voidwriteClientError(int connStatus, OutputStream os, Packet packet) This method is added for the case of the sub-class wants to override the method to print details.Methods inherited from class com.sun.xml.ws.api.server.Adapter
getEndpoint, getEndpointComponent, getPool, getSPI, reconfigure
-
Field Details
-
wsdls
SDDocuments keyed by the query string like "?abc". Used for serving documents via HTTP GET. Empty if the endpoint doesn't haveServiceDefinition. Read-only. -
owner
-
urlPattern
Servlet URL pattern with which thisHttpAdapteris associated. -
stickyCookie
protected boolean stickyCookie -
disableJreplicaCookie
protected boolean disableJreplicaCookie -
NO_OP_COMPLETION_CALLBACK
-
dump
public static volatile boolean dumpDumps what goes across HTTP transport. -
dump_threshold
public static volatile int dump_threshold -
publishStatusPage
public static volatile boolean publishStatusPage
-
-
Constructor Details
-
HttpAdapter
Deprecated.remove as soon as we can update the test util.- Parameters:
endpoint- web service endpointowner- list of related adapters
-
HttpAdapter
protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner, String urlPattern)
-
-
Method Details
-
createAlone
Creates a loneHttpAdapterthat does not know of any otherHttpAdapters. This is convenient for creating anHttpAdapterfor an environment where they don't know each other (such as JavaSE deployment.)- Parameters:
endpoint- web service endpoint- Returns:
- singe adapter to process HTTP messages
-
getServiceDefinition
Return the last known service definition of the endpoint.- Returns:
- The service definition of the endpoint
-
initWSDLMap
Fill in WSDL map.- Parameters:
serviceDefinition- service definition
-
getValidPath
Returns the "/abc/def/ghi" portion if the URL pattern is "/abc/def/ghi/*". -
createToolkit
protected com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit createToolkit()Description copied from class:AdapterCreates aAdapter<TK extends Adapter.Toolkit>.Toolkitinstance.If the derived class doesn't have to add any per-thread state to
Adapter<TK extends Adapter.Toolkit>.Toolkit, simply implement this asnew Toolkit().- Specified by:
createToolkitin classAdapter<com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit>
-
handle
Receives the incoming HTTP connection and dispatches it to JAX-WS. This method returns when JAX-WS completes processing the request and the whole reply is written toWSHTTPConnection.This method is invoked by the lower-level HTTP stack, and "connection" here is an HTTP connection.
To populate a request
Packetwith more info, definepropertiesonWSHTTPConnection.- Parameters:
connection- to receive/send HTTP messages for web service endpoints- Throws:
IOException- when I/O errors happen
-
handleGet
- Throws:
IOException
-
addSatellites
-
fixQuotesAroundSoapAction
Some stacks may send non WS-I BP 1.2 conforming SoapAction. Make sure SOAPAction is quoted asPacket.soapActionexpects quoted soapAction value.- Parameters:
soapAction- SoapAction HTTP Header- Returns:
- quoted SOAPAction value
-
getNonAnonymousResponseProcessor
-
writeClientError
protected void writeClientError(int connStatus, @NotNull OutputStream os, @NotNull Packet packet) throws IOException This method is added for the case of the sub-class wants to override the method to print details. E.g. convert soapfault as HTML msg for 403 error connstatus.- Throws:
IOException
-
invokeAsync
- Throws:
IOException
-
invokeAsync
public void invokeAsync(WSHTTPConnection con, HttpAdapter.CompletionCallback callback) throws IOException - Throws:
IOException
-
publishWSDL
Sends out the WSDL (and other referenced documents) in response to the GET requests to URLs like "?wsdl" or "?xsd=2".- Parameters:
con- The connection to which the data will be sent.- Throws:
IOException- when I/O errors happen
-
getPortAddressResolver
-
getDocumentAddressResolver
-
setPublishStatus
public static void setPublishStatus(boolean publish) -
setDump
public static void setDump(boolean dumpMessages) -
setDumpTreshold
public static void setDumpTreshold(int treshold)
-