Class AbstractHttpSenderConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.http.AbstractHttpSenderConnection
- All Implemented Interfaces:
AutoCloseable
,FaultAwareWebServiceConnection
,HeadersAwareSenderWebServiceConnection
,WebServiceConnection
- Direct Known Subclasses:
ClientHttpRequestConnection
,CommonsHttpConnection
,HttpComponents5Connection
,HttpComponentsConnection
,HttpUrlConnection
,JdkHttpClientConnection
public abstract class AbstractHttpSenderConnection
extends AbstractSenderConnection
implements FaultAwareWebServiceConnection
Abstract base class for
WebServiceConnection
implementations that send request over HTTP.- Since:
- 1.0.0
- Author:
- Arjen Poutsma, Andreas Veithen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
Returns the error message.protected abstract InputStream
Returns the raw, possibly compressed input stream to read the response from.protected abstract int
Returns the HTTP status code of the response.protected abstract long
Returns the length of the response.protected final InputStream
Returns the input stream to read the response from.protected abstract String
Returns the HTTP status message of the response.final boolean
hasError()
Indicates whether this connection has an error.final boolean
hasFault()
Indicates whether this connection received a fault.protected final boolean
Indicates whether this connection has a response.final void
setFault
(boolean fault) Deprecated.final void
setFaultCode
(QName faultCode) Sets a specific fault code.Methods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStream, getRequestOutputStream, onClose
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, onSendAfterWrite, onSendBeforeWrite, receive, send
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ws.transport.HeadersAwareSenderWebServiceConnection
addRequestHeader, getResponseHeaderNames, getResponseHeaders
Methods inherited from interface org.springframework.ws.transport.WebServiceConnection
close, getUri, receive, send
-
Constructor Details
-
AbstractHttpSenderConnection
public AbstractHttpSenderConnection()
-
-
Method Details
-
hasError
Description copied from interface:WebServiceConnection
Indicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.- Specified by:
hasError
in interfaceWebServiceConnection
- Returns:
true
if this connection has an error;false
otherwise.- Throws:
IOException
-
getErrorMessage
Description copied from interface:WebServiceConnection
Returns the error message.- Specified by:
getErrorMessage
in interfaceWebServiceConnection
- Returns:
- the connection error message, if any; returns
null
when no error is present - Throws:
IOException
- See Also:
-
hasResponse
Description copied from class:AbstractSenderConnection
Indicates whether this connection has a response.- Specified by:
hasResponse
in classAbstractSenderConnection
- Throws:
IOException
-
getResponseInputStream
Description copied from class:AbstractSenderConnection
Returns the input stream to read the response from.- Specified by:
getResponseInputStream
in classAbstractSenderConnection
- Throws:
IOException
-
getResponseCode
Returns the HTTP status code of the response.- Throws:
IOException
-
getResponseMessage
Returns the HTTP status message of the response.- Throws:
IOException
-
getResponseContentLength
Returns the length of the response.- Throws:
IOException
-
getRawResponseInputStream
Returns the raw, possibly compressed input stream to read the response from.- Throws:
IOException
-
hasFault
Description copied from interface:FaultAwareWebServiceConnection
Indicates whether this connection received a fault.Typically implemented by looking at an HTTP status code.
- Specified by:
hasFault
in interfaceFaultAwareWebServiceConnection
- Returns:
true
if this connection received a fault;false
otherwise.- Throws:
IOException
- in case of I/O errors
-
setFault
Deprecated.Description copied from interface:FaultAwareWebServiceConnection
Sets whether this connection will send a fault.Typically implemented by setting an HTTP status code.
- Specified by:
setFault
in interfaceFaultAwareWebServiceConnection
- Parameters:
fault
-true
if this will send a fault;false
otherwise.
-
setFaultCode
Description copied from interface:FaultAwareWebServiceConnection
Sets a specific fault code.Typically implemented by setting an HTTP status code.
- Specified by:
setFaultCode
in interfaceFaultAwareWebServiceConnection
- Parameters:
faultCode
- the fault code to be set on the connection, ornull
for no fault.- Throws:
IOException
- in case of I/O errors
-