Class CommonsHttpMessageSender

java.lang.Object
org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
org.springframework.ws.transport.http.CommonsHttpMessageSender
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, WebServiceMessageSender

@Deprecated public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSender implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Deprecated.
WebServiceMessageSender implementation that uses Jakarta Commons HttpClient to execute POST requests.

Allows to use a preconfigured HttpClient instance, potentially with authentication, HTTP connection pooling, etc. Authentication can also be set by injecting a Credentials instance (such as the UsernamePasswordCredentials).

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
  • Constructor Details

    • CommonsHttpMessageSender

      public CommonsHttpMessageSender()
      Deprecated.
      Create a new instance of the CommonsHttpMessageSender with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
    • CommonsHttpMessageSender

      public CommonsHttpMessageSender(org.apache.commons.httpclient.HttpClient httpClient)
      Deprecated.
      Create a new instance of the CommonsHttpMessageSender with the given HttpClient instance.
      Parameters:
      httpClient - the HttpClient instance to use for this sender
  • Method Details

    • getHttpClient

      public org.apache.commons.httpclient.HttpClient getHttpClient()
      Deprecated.
      Returns the HttpClient used by this message sender.
    • setHttpClient

      public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
      Deprecated.
      Set the HttpClient used by this message sender.
    • getCredentials

      public org.apache.commons.httpclient.Credentials getCredentials()
      Deprecated.
      Returns the credentials to be used.
    • setCredentials

      public void setCredentials(org.apache.commons.httpclient.Credentials credentials)
      Deprecated.
      Sets the credentials to be used. If not set, no authentication is done.
      See Also:
      • UsernamePasswordCredentials
      • NTCredentials
    • setConnectionTimeout

      public void setConnectionTimeout(int timeout)
      Deprecated.
      Sets the timeout until a connection is etablished. A value of 0 means never timeout.
      Parameters:
      timeout - the timeout value in milliseconds
      See Also:
      • HttpConnectionParams.setConnectionTimeout(int)
    • setReadTimeout

      public void setReadTimeout(int timeout)
      Deprecated.
      Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.
      Parameters:
      timeout - the timeout value in milliseconds
      See Also:
      • HttpConnectionParams.setSoTimeout(int)
    • setMaxTotalConnections

      public void setMaxTotalConnections(int maxTotalConnections)
      Deprecated.
      Sets the maximum number of connections allowed for the underlying HttpClient.
      Parameters:
      maxTotalConnections - the maximum number of connections allowed
      See Also:
      • HttpConnectionManagerParams.setMaxTotalConnections(int)
    • setMaxConnectionsPerHost

      public void setMaxConnectionsPerHost(Map<String,String> maxConnectionsPerHost) throws org.apache.commons.httpclient.URIException
      Deprecated.
      Sets the maximum number of connections per host for the underlying HttpClient. The maximum number of connections per host can be set in a form accepted by the java.util.Properties class, like as follows:
       https://www.example.com=1
       http://www.example.com:8080=7
       www.springframework.org=10
       *=5
       
      The host can be specified as hostname, or as URI (with scheme and port). The special host name * can be used to specify HostConfiguration.ANY_HOST_CONFIGURATION.
      Parameters:
      maxConnectionsPerHost - a properties object specifying the maximum number of connection
      Throws:
      org.apache.commons.httpclient.URIException
      See Also:
      • HttpConnectionManagerParams.setMaxConnectionsPerHost(org.apache.commons.httpclient.HostConfiguration, int)
    • getAuthScope

      public org.apache.commons.httpclient.auth.AuthScope getAuthScope()
      Deprecated.
      Returns the authentication scope to be used. Only used when the credentials property has been set.

      By default, the AuthScope.ANY is returned.

    • setAuthScope

      public void setAuthScope(org.apache.commons.httpclient.auth.AuthScope authScope)
      Deprecated.
      Sets the authentication scope to be used. Only used when the credentials property has been set.

      By default, the AuthScope.ANY is used.

      See Also:
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Deprecated.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Deprecated.
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • createConnection

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