public class HttpServletConnection extends AbstractReceiverConnection implements EndpointAwareWebServiceConnection, FaultAwareWebServiceConnection
WebServiceConnection that is based on the Servlet API.| Modifier | Constructor and Description |
|---|---|
protected |
HttpServletConnection(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
Constructs a new servlet connection with the given
HttpServletRequest and
HttpServletResponse. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addResponseHeader(String name,
String value)
Adds a response header with the given name and value.
|
void |
endpointNotFound()
Called when an endpoint is not found.
|
String |
getErrorMessage()
Returns the error message.
|
HttpServletRequest |
getHttpServletRequest()
Returns the
HttpServletRequest for this connection. |
HttpServletResponse |
getHttpServletResponse()
Returns the
HttpServletResponse for this connection. |
protected Iterator<String> |
getRequestHeaderNames()
Returns an iteration over all the header names this request contains.
|
protected Iterator<String> |
getRequestHeaders(String name)
Returns an iteration over all the string values of the specified header.
|
protected InputStream |
getRequestInputStream()
Returns the input stream to read the response from.
|
protected OutputStream |
getResponseOutputStream()
Returns the output stream to write the request to.
|
URI |
getUri()
Returns the URI for this connection.
|
boolean |
hasError()
Indicates whether this connection has an error.
|
boolean |
hasFault()
Indicates whether this connection received a fault.
|
void |
onClose()
Template method invoked from
AbstractWebServiceConnection.close(). |
protected void |
onSendAfterWrite(WebServiceMessage message)
Called after the given message has been written to the
TransportOutputStream. |
void |
setFault(boolean fault)
Deprecated.
|
void |
setFaultCode(QName faultCode)
Sets a specific fault code.
|
createTransportInputStream, createTransportOutputStreamclose, onReceiveAfterRead, onReceiveBeforeRead, onSendBeforeWrite, receive, sendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, receive, sendprotected HttpServletConnection(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
HttpServletRequest and
HttpServletResponse.public HttpServletRequest getHttpServletRequest()
HttpServletRequest for this connection.public HttpServletResponse getHttpServletResponse()
HttpServletResponse for this connection.public void endpointNotFound()
EndpointAwareWebServiceConnectionendpointNotFound in interface EndpointAwareWebServiceConnectionpublic boolean hasError()
throws IOException
WebServiceConnectionhasError in interface WebServiceConnectiontrue if this connection has an error; false otherwise.IOExceptionpublic String getErrorMessage() throws IOException
WebServiceConnectiongetErrorMessage in interface WebServiceConnectionnull when no error is presentIOExceptionWebServiceConnection.hasError()public URI getUri() throws URISyntaxException
WebServiceConnectiongetUri in interface WebServiceConnectionURISyntaxExceptionprotected Iterator<String> getRequestHeaderNames() throws IOException
AbstractReceiverConnectionIterator if
there are no headers.getRequestHeaderNames in class AbstractReceiverConnectionIOExceptionprotected Iterator<String> getRequestHeaders(String name) throws IOException
AbstractReceiverConnectionIterator
if there are no headers of the specified name.getRequestHeaders in class AbstractReceiverConnectionIOExceptionprotected InputStream getRequestInputStream() throws IOException
AbstractReceiverConnectiongetRequestInputStream in class AbstractReceiverConnectionIOExceptionprotected void addResponseHeader(String name, String value) throws IOException
AbstractReceiverConnectionaddResponseHeader in class AbstractReceiverConnectionname - the name of the headervalue - the value of the headerIOExceptionprotected OutputStream getResponseOutputStream() throws IOException
AbstractReceiverConnectiongetResponseOutputStream in class AbstractReceiverConnectionIOExceptionprotected void onSendAfterWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnectionTransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).
Default implementation does nothing.
onSendAfterWrite in class AbstractWebServiceConnectionmessage - the messageIOException - when an I/O exception occurspublic void onClose()
throws IOException
AbstractReceiverConnectionAbstractWebServiceConnection.close(). Default implementation is empty.onClose in class AbstractReceiverConnectionIOException - if an I/O error occurs when closing this connectionpublic boolean hasFault()
throws IOException
FaultAwareWebServiceConnectionTypically implemented by looking at an HTTP status code.
hasFault in interface FaultAwareWebServiceConnectiontrue if this connection received a fault; false otherwise.IOException - in case of I/O errors@Deprecated public void setFault(boolean fault) throws IOException
FaultAwareWebServiceConnectionTypically implemented by setting an HTTP status code.
setFault in interface FaultAwareWebServiceConnectionfault - true if this will send a fault; false otherwise.IOException - in case of I/O errorspublic void setFaultCode(QName faultCode) throws IOException
FaultAwareWebServiceConnectionTypically implemented by setting an HTTP status code.
setFaultCode in interface FaultAwareWebServiceConnectionfaultCode - the fault code to be set on the connection, or null for no fault.IOException - in case of I/O errors