Class HttpUrlConnectionMessageSender

java.lang.Object
org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
org.springframework.ws.transport.http.HttpUrlConnectionMessageSender
All Implemented Interfaces:
WebServiceMessageSender
Direct Known Subclasses:
HttpsUrlConnectionMessageSender

public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessageSender
WebServiceMessageSender implementation that uses standard J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.

Consider HttpComponentsMessageSender for more sophisticated needs: this class is rather limited in its capabilities.

Since:
1.0.0
Author:
Arjen Poutsma, Kazuki Shimizu
See Also:
  • Constructor Details

    • HttpUrlConnectionMessageSender

      public HttpUrlConnectionMessageSender()
  • Method Details

    • setConnectionTimeout

      public void setConnectionTimeout(Duration connectTimeout)
      Sets the timeout until a connection is established.
      Parameters:
      connectTimeout - the timeout value
      Since:
      3.0.1
      See Also:
    • setReadTimeout

      public void setReadTimeout(Duration readTimeout)
      Set the socket read timeout.
      Parameters:
      readTimeout - the timeout value
      Since:
      3.0.1
      See Also:
    • createConnection

      public WebServiceConnection createConnection(URI uri) throws IOException
      Description copied from interface: WebServiceMessageSender
      Create a new WebServiceConnection to the specified URI.
      Parameters:
      uri - the URI to open a connection to
      Returns:
      the new connection
      Throws:
      IOException - in case of I/O errors
    • prepareConnection

      protected void prepareConnection(HttpURLConnection connection) throws IOException
      Template method for preparing the given HttpURLConnection.

      The default implementation prepares the connection for input and output, sets the HTTP method to POST, disables caching, and sets the Accept-Encoding header to gzip, if applicable.

      Parameters:
      connection - the connection to prepare
      Throws:
      IOException - in case of I/O errors