Spring Web Services Framework

org.springframework.ws.transport.http
Class CommonsHttpMessageSender

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

Deprecated. In favor of HttpComponentsMessageSender

@Deprecated
public class CommonsHttpMessageSender
extends AbstractHttpWebServiceMessageSender
implements InitializingBean, DisposableBean

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:
HttpUrlConnectionMessageSender, HttpClient, setCredentials(Credentials)

Field Summary
 
Fields inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
logger
 
Constructor Summary
CommonsHttpMessageSender()
          Deprecated. Create a new instance of the CommonsHttpMessageSender with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
CommonsHttpMessageSender(HttpClient httpClient)
          Deprecated. Create a new instance of the CommonsHttpMessageSender with the given HttpClient instance.
 
Method Summary
 void afterPropertiesSet()
          Deprecated.  
 WebServiceConnection createConnection(URI uri)
          Deprecated. Create a new WebServiceConnection to the specified URI.
 void destroy()
          Deprecated.  
 AuthScope getAuthScope()
          Deprecated. Returns the authentication scope to be used.
 Credentials getCredentials()
          Deprecated. Returns the credentials to be used.
 HttpClient getHttpClient()
          Deprecated. Returns the HttpClient used by this message sender.
 void setAuthScope(AuthScope authScope)
          Deprecated. Sets the authentication scope to be used.
 void setConnectionTimeout(int timeout)
          Deprecated. Sets the timeout until a connection is etablished.
 void setCredentials(Credentials credentials)
          Deprecated. Sets the credentials to be used.
 void setHttpClient(HttpClient httpClient)
          Deprecated. Set the HttpClient used by this message sender.
 void setMaxConnectionsPerHost(Map<String,String> maxConnectionsPerHost)
          Deprecated. Sets the maximum number of connections per host for the underlying HttpClient.
 void setMaxTotalConnections(int maxTotalConnections)
          Deprecated. Sets the maximum number of connections allowed for the underlying HttpClient.
 void setReadTimeout(int timeout)
          Deprecated. Set the socket read timeout for the underlying HttpClient.
 
Methods inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
isAcceptGzipEncoding, setAcceptGzipEncoding, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsHttpMessageSender

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


CommonsHttpMessageSender

public CommonsHttpMessageSender(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 Detail

getHttpClient

public HttpClient getHttpClient()
Deprecated. 
Returns the HttpClient used by this message sender.


setHttpClient

public void setHttpClient(HttpClient httpClient)
Deprecated. 
Set the HttpClient used by this message sender.


getCredentials

public Credentials getCredentials()
Deprecated. 
Returns the credentials to be used.


setCredentials

public void setCredentials(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 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:
URIException
See Also:
HttpConnectionManagerParams.setMaxConnectionsPerHost(org.apache.commons.httpclient.HostConfiguration, int)

getAuthScope

public 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(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:
setCredentials(Credentials)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Deprecated. 
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
Deprecated. 
Specified by:
destroy in interface 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

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.