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
public class HttpAdapter extends Adapter<com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit>
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 Classes Modifier and Type Class Description static interface
HttpAdapter.CompletionCallback
-
Nested classes/interfaces inherited from class com.sun.xml.ws.api.server.Adapter
Adapter.Toolkit
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
disableJreplicaCookie
static boolean
dump
Dumps what goes across HTTP transport.static int
dump_threshold
static HttpAdapter.CompletionCallback
NO_OP_COMPLETION_CALLBACK
HttpAdapterList<? extends HttpAdapter>
owner
static boolean
publishStatusPage
protected boolean
stickyCookie
String
urlPattern
Servlet URL pattern with which thisHttpAdapter
is associated.protected Map<String,SDDocument>
wsdls
SDDocument
s keyed by the query string like "?abc".
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner)
Deprecated.remove as soon as we can update the test util.protected
HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner, String urlPattern)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addSatellites(Packet packet)
static HttpAdapter
createAlone(WSEndpoint endpoint)
Creates a loneHttpAdapter
that does not know of any otherHttpAdapter
s.protected com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit
createToolkit()
Creates aAdapter.Toolkit
instance.static String
fixQuotesAroundSoapAction(String soapAction)
Some stacks may send non WS-I BP 1.2 conforming SoapAction.DocumentAddressResolver
getDocumentAddressResolver(PortAddressResolver portAddressResolver)
protected NonAnonymousResponseProcessor
getNonAnonymousResponseProcessor()
PortAddressResolver
getPortAddressResolver(String baseAddress)
ServiceDefinition
getServiceDefinition()
Return the last known service definition of the endpoint.String
getValidPath()
Returns the "/abc/def/ghi" portion if the URL pattern is "/abc/def/ghi/*".void
handle(WSHTTPConnection connection)
Receives the incoming HTTP connection and dispatches it to JAX-WS.boolean
handleGet(WSHTTPConnection connection)
void
initWSDLMap(ServiceDefinition serviceDefinition)
Fill in WSDL map.void
invokeAsync(WSHTTPConnection con)
void
invokeAsync(WSHTTPConnection con, HttpAdapter.CompletionCallback callback)
void
publishWSDL(WSHTTPConnection con)
Sends out the WSDL (and other referenced documents) in response to the GET requests to URLs like "?wsdl" or "?xsd=2".static void
setDump(boolean dumpMessages)
static void
setPublishStatus(boolean publish)
protected void
writeClientError(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 Detail
-
wsdls
protected Map<String,SDDocument> wsdls
SDDocument
s keyed by the query string like "?abc". Used for serving documents via HTTP GET. Empty if the endpoint doesn't haveServiceDefinition
. Read-only.
-
owner
public final HttpAdapterList<? extends HttpAdapter> owner
-
urlPattern
public final String urlPattern
Servlet URL pattern with which thisHttpAdapter
is associated.
-
stickyCookie
protected boolean stickyCookie
-
disableJreplicaCookie
protected boolean disableJreplicaCookie
-
NO_OP_COMPLETION_CALLBACK
public static final HttpAdapter.CompletionCallback NO_OP_COMPLETION_CALLBACK
-
dump
public static volatile boolean dump
Dumps what goes across HTTP transport.
-
dump_threshold
public static volatile int dump_threshold
-
publishStatusPage
public static volatile boolean publishStatusPage
-
-
Constructor Detail
-
HttpAdapter
protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner)
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 Detail
-
createAlone
public static HttpAdapter createAlone(WSEndpoint endpoint)
Creates a loneHttpAdapter
that does not know of any otherHttpAdapter
s. This is convenient for creating anHttpAdapter
for 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
public ServiceDefinition getServiceDefinition()
Return the last known service definition of the endpoint.- Returns:
- The service definition of the endpoint
-
initWSDLMap
public final void initWSDLMap(ServiceDefinition serviceDefinition)
Fill in WSDL map.- Parameters:
sdef
- service definition
-
getValidPath
public String 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:Adapter
Creates aAdapter.Toolkit
instance.If the derived class doesn't have to add any per-thread state to
Adapter.Toolkit
, simply implement this asnew Toolkit()
.- Specified by:
createToolkit
in classAdapter<com.sun.xml.ws.transport.http.HttpAdapter.HttpToolkit>
-
handle
public void handle(@NotNull WSHTTPConnection connection) throws IOException
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
Packet
with more info, defineproperties
onWSHTTPConnection
.- Parameters:
connection
- to receive/send HTTP messages for web service endpoints- Throws:
IOException
- when I/O errors happen
-
handleGet
public boolean handleGet(@NotNull WSHTTPConnection connection) throws IOException
- Throws:
IOException
-
addSatellites
protected void addSatellites(Packet packet)
-
fixQuotesAroundSoapAction
public static String fixQuotesAroundSoapAction(String soapAction)
Some stacks may send non WS-I BP 1.2 conforming SoapAction. Make sure SOAPAction is quoted asPacket.soapAction
expects quoted soapAction value.- Parameters:
soapAction
- SoapAction HTTP Header- Returns:
- quoted SOAPAction value
-
getNonAnonymousResponseProcessor
protected NonAnonymousResponseProcessor 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.- Parameters:
os
-- Throws:
IOException
-
invokeAsync
public void invokeAsync(WSHTTPConnection con) throws IOException
- Throws:
IOException
-
invokeAsync
public void invokeAsync(WSHTTPConnection con, HttpAdapter.CompletionCallback callback) throws IOException
- Throws:
IOException
-
publishWSDL
public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException
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
public PortAddressResolver getPortAddressResolver(String baseAddress)
-
getDocumentAddressResolver
public DocumentAddressResolver getDocumentAddressResolver(PortAddressResolver portAddressResolver)
-
setPublishStatus
public static void setPublishStatus(boolean publish)
-
setDump
public static void setDump(boolean dumpMessages)
-
-