Class ClientHttpRequestConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.http.AbstractHttpSenderConnection
org.springframework.ws.transport.http.ClientHttpRequestConnection
- All Implemented Interfaces:
AutoCloseable
,FaultAwareWebServiceConnection
,HeadersAwareSenderWebServiceConnection
,WebServiceConnection
Implementation of the
WebServiceConnection
interface that is based on the Spring 3 ClientHttpRequest
and ClientHttpResponse
.- Since:
- 2.2
- Author:
- Krzysztof Trojan, Arjen Poutsma, Greg Turnquist
-
Constructor Summary
ConstructorDescriptionClientHttpRequestConnection
(org.springframework.http.client.ClientHttpRequest request) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestHeader
(String name, String value) Adds a request header with the given name and value.org.springframework.http.client.ClientHttpRequest
org.springframework.http.client.ClientHttpResponse
protected InputStream
Returns the raw, possibly compressed input stream to read the response from.protected OutputStream
Returns the output stream to write the request to.protected int
Returns the HTTP status code of the response.protected long
Returns the length of the response.Returns an iteration over all the header names this request contains.getResponseHeaders
(String name) Returns an iteration over all the string values of the specified header.protected String
Returns the HTTP status message of the response.getUri()
Returns the URI for this connection.protected void
onClose()
Template method invoked fromAbstractWebServiceConnection.close()
.protected void
onSendAfterWrite
(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream
.Methods inherited from class org.springframework.ws.transport.http.AbstractHttpSenderConnection
getErrorMessage, getResponseInputStream, hasError, hasFault, hasResponse, setFault, setFaultCode
Methods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStream
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, 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.WebServiceConnection
close, receive, send
-
Constructor Details
-
ClientHttpRequestConnection
public ClientHttpRequestConnection(org.springframework.http.client.ClientHttpRequest request)
-
-
Method Details
-
getClientHttpRequest
public org.springframework.http.client.ClientHttpRequest getClientHttpRequest() -
getClientHttpResponse
public org.springframework.http.client.ClientHttpResponse getClientHttpResponse() -
getUri
Description copied from interface:WebServiceConnection
Returns the URI for this connection.- Throws:
URISyntaxException
-
addRequestHeader
Description copied from interface:HeadersAwareSenderWebServiceConnection
Adds a request header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.- Parameters:
name
- the name of the headervalue
- the value of the header- Throws:
IOException
-
getRequestOutputStream
Description copied from class:AbstractSenderConnection
Returns the output stream to write the request to.- Specified by:
getRequestOutputStream
in classAbstractSenderConnection
- Throws:
IOException
-
onSendAfterWrite
Description copied from class:AbstractWebServiceConnection
Called after the given message has been written to theTransportOutputStream
. Called fromAbstractWebServiceConnection.send(WebServiceMessage)
.Default implementation does nothing.
- Overrides:
onSendAfterWrite
in classAbstractWebServiceConnection
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-
getResponseContentLength
Description copied from class:AbstractHttpSenderConnection
Returns the length of the response.- Specified by:
getResponseContentLength
in classAbstractHttpSenderConnection
- Throws:
IOException
-
getResponseHeaderNames
Description copied from interface:HeadersAwareSenderWebServiceConnection
Returns an iteration over all the header names this request contains. Returns an emptyIterator
if there are no headers.- Throws:
IOException
-
getResponseHeaders
Description copied from interface:HeadersAwareSenderWebServiceConnection
Returns an iteration over all the string values of the specified header. Returns an emptyIterator
if there are no headers of the specified name.- Throws:
IOException
-
getResponseCode
Description copied from class:AbstractHttpSenderConnection
Returns the HTTP status code of the response.- Specified by:
getResponseCode
in classAbstractHttpSenderConnection
- Throws:
IOException
-
getResponseMessage
Description copied from class:AbstractHttpSenderConnection
Returns the HTTP status message of the response.- Specified by:
getResponseMessage
in classAbstractHttpSenderConnection
- Throws:
IOException
-
getRawResponseInputStream
Description copied from class:AbstractHttpSenderConnection
Returns the raw, possibly compressed input stream to read the response from.- Specified by:
getRawResponseInputStream
in classAbstractHttpSenderConnection
- Throws:
IOException
-
onClose
Description copied from class:AbstractSenderConnection
Template method invoked fromAbstractWebServiceConnection.close()
. Default implementation is empty.- Overrides:
onClose
in classAbstractSenderConnection
- Throws:
IOException
- if an I/O error occurs when closing this connection
-