Class HttpUrlConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.http.AbstractHttpSenderConnection
org.springframework.ws.transport.http.HttpUrlConnection
- All Implemented Interfaces:
AutoCloseable,FaultAwareWebServiceConnection,HeadersAwareSenderWebServiceConnection,WebServiceConnection
Implementation of the
WebServiceConnection interface that uses a
HttpURLConnection.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpUrlConnection(HttpURLConnection connection) Creates a new instance of theHttpUrlConnectionwith the givenHttpURLConnection. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestHeader(String name, String value) Adds a request header with the given name and value.protected InputStreamReturns the raw, possibly compressed input stream to read the response from.protected OutputStreamReturns the output stream to write the request to.protected intReturns the HTTP status code of the response.protected longReturns 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 StringReturns the HTTP status message of the response.getUri()Returns the URI for this connection.voidonClose()Template method invoked fromAbstractWebServiceConnection.close().protected voidonSendAfterWrite(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, setFaultCodeMethods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStreamMethods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, onSendBeforeWrite, receive, sendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ws.transport.WebServiceConnection
close, receive, send
-
Constructor Details
-
HttpUrlConnection
Creates a new instance of theHttpUrlConnectionwith the givenHttpURLConnection.- Parameters:
connection- theHttpURLConnection
-
-
Method Details
-
getConnection
-
onClose
public void onClose()Description copied from class:AbstractSenderConnectionTemplate method invoked fromAbstractWebServiceConnection.close(). Default implementation is empty.- Overrides:
onClosein classAbstractSenderConnection
-
getUri
Description copied from interface:WebServiceConnectionReturns the URI for this connection.- Throws:
URISyntaxException
-
addRequestHeader
Description copied from interface:HeadersAwareSenderWebServiceConnectionAdds 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:AbstractSenderConnectionReturns the output stream to write the request to.- Specified by:
getRequestOutputStreamin classAbstractSenderConnection- Throws:
IOException
-
onSendAfterWrite
Description copied from class:AbstractWebServiceConnectionCalled after the given message has been written to theTransportOutputStream. Called fromAbstractWebServiceConnection.send(WebServiceMessage).Default implementation does nothing.
- Overrides:
onSendAfterWritein classAbstractWebServiceConnection- Parameters:
message- the message- Throws:
IOException- when an I/O exception occurs
-
getResponseContentLength
Description copied from class:AbstractHttpSenderConnectionReturns the length of the response.- Specified by:
getResponseContentLengthin classAbstractHttpSenderConnection- Throws:
IOException
-
getResponseHeaderNames
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturns an iteration over all the header names this request contains. Returns an emptyIteratorif there are no headers.- Throws:
IOException
-
getResponseHeaders
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturns an iteration over all the string values of the specified header. Returns an emptyIteratorif there are no headers of the specified name.- Throws:
IOException
-
getResponseCode
Description copied from class:AbstractHttpSenderConnectionReturns the HTTP status code of the response.- Specified by:
getResponseCodein classAbstractHttpSenderConnection- Throws:
IOException
-
getResponseMessage
Description copied from class:AbstractHttpSenderConnectionReturns the HTTP status message of the response.- Specified by:
getResponseMessagein classAbstractHttpSenderConnection- Throws:
IOException
-
getRawResponseInputStream
Description copied from class:AbstractHttpSenderConnectionReturns the raw, possibly compressed input stream to read the response from.- Specified by:
getRawResponseInputStreamin classAbstractHttpSenderConnection- Throws:
IOException
-