Class HttpComponents5MessageSender
java.lang.Object
org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
org.springframework.ws.transport.http.AbstractHttpComponents5MessageSender
org.springframework.ws.transport.http.HttpComponents5MessageSender
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,WebServiceMessageSender
public class HttpComponents5MessageSender
extends AbstractHttpComponents5MessageSender
implements org.springframework.beans.factory.InitializingBean
AbstractHttpComponents5MessageSender implementation that configures the
underlying Apache HttpClient
that executes POST requests.
To specify the HttpClient, consider using
SimpleHttpComponents5MessageSender instead.
- Since:
- 4.0.5
- See Also:
-
HttpClient
-
Field Summary
Fields inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
logger -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of theHttpClientMessageSenderwith a defaultHttpClientthat uses a defaultPoolingHttpClientConnectionManager.HttpComponents5MessageSender(org.apache.hc.client5.http.classic.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.apache.hc.client5.http.classic.HttpClientReturn theHttpClientused by this message sender.voidsetAuthScope(org.apache.hc.client5.http.auth.AuthScope authScope) Set the authentication scope to be used.voidsetConnectionTimeout(Duration timeout) Set the timeout until a connection is established.voidsetCredentials(org.apache.hc.client5.http.auth.Credentials credentials) Set the credentials to be used.voidsetHttpClient(org.apache.hc.client5.http.classic.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.as of 4.1.0 in favor ofSimpleHttpComponents5MessageSendervoidsetMaxConnectionsPerHost(Map<String, String> maxConnectionsPerHost) Sets the maximum number of connections per host for the underlying HttpClient.voidsetMaxTotalConnections(int maxTotalConnections) Sets the maximum number of connections allowed for the underlying HttpClient.voidsetReadTimeout(Duration timeout) Set the socket read timeout for the underlying HttpClient.Methods inherited from class org.springframework.ws.transport.http.AbstractHttpComponents5MessageSender
createConnection, createContext, destroyMethods inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
isAcceptGzipEncoding, setAcceptGzipEncoding, supports
-
Constructor Details
-
HttpComponents5MessageSender
public HttpComponents5MessageSender()Create a new instance of theHttpClientMessageSenderwith a defaultHttpClientthat uses a defaultPoolingHttpClientConnectionManager. -
HttpComponents5MessageSender
@Deprecated(since="4.1.0", forRemoval=true) public HttpComponents5MessageSender(org.apache.hc.client5.http.classic.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.as of 4.1.0 in favor ofSimpleHttpComponents5MessageSenderCreate a new instance of theHttpComponents5MessageSenderwith the givenHttpClientinstance.This constructor does not change the given
HttpClientin any way. As such, it does not set timeouts, nor does it add theHttpComponentsMessageSender.RemoveSoapHeadersInterceptor.- Parameters:
httpClient- the HttpClient instance to use for this sender
-
-
Method Details
-
getHttpClient
public org.apache.hc.client5.http.classic.HttpClient getHttpClient()Description copied from class:AbstractHttpComponents5MessageSenderReturn theHttpClientused by this message sender.- Specified by:
getHttpClientin classAbstractHttpComponents5MessageSender
-
setAuthScope
public void setAuthScope(org.apache.hc.client5.http.auth.AuthScope authScope) Set the authentication scope to be used. Only used when thecredentialsproperty has been set. -
setCredentials
public void setCredentials(org.apache.hc.client5.http.auth.Credentials credentials) Set the credentials to be used. If not set, no authentication is done. -
setHttpClient
@Deprecated(since="4.1.0", forRemoval=true) public void setHttpClient(org.apache.hc.client5.http.classic.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.as of 4.1.0 in favor ofSimpleHttpComponents5MessageSenderSet theHttpClientused by this message sender.This effectively disable any customization and does not change the given
HttpClientin any way. As such, it does not set timeouts, nor does it add theHttpComponentsMessageSender.RemoveSoapHeadersInterceptor.- Parameters:
httpClient- the HttpClient to use
-
setConnectionTimeout
Set the timeout until a connection is established. -
setReadTimeout
Set the socket read timeout for the underlying HttpClient. -
setMaxTotalConnections
public void setMaxTotalConnections(int maxTotalConnections) Sets the maximum number of connections allowed for the underlying HttpClient. -
setMaxConnectionsPerHost
Sets the maximum number of connections per host for the underlying HttpClient. -
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
SimpleHttpComponents5MessageSender