public class WebServiceTemplateBuilder extends Object
WebServiceTemplate
. Provides
convenience methods to register message senders
, client interceptors
and
customizers
.
By default the built WebServiceTemplate
uses the most suitable HTTP-based
WebServiceMessageSender
, call detectHttpMessageSender(false)
if you prefer to keep the default. In a typical
auto-configured Spring Boot application this builder is available as a bean and can be
injected whenever a WebServiceTemplate
is needed.
Constructor and Description |
---|
WebServiceTemplateBuilder(WebServiceTemplateCustomizer... customizers) |
Modifier and Type | Method and Description |
---|---|
WebServiceTemplateBuilder |
additionalCustomizers(Collection<? extends WebServiceTemplateCustomizer> customizers)
Add additional
WebServiceTemplateCustomizers
that should be applied to the WebServiceTemplate . |
WebServiceTemplateBuilder |
additionalCustomizers(WebServiceTemplateCustomizer... customizers)
Add additional
WebServiceTemplateCustomizers
that should be applied to the WebServiceTemplate . |
WebServiceTemplateBuilder |
additionalInterceptors(org.springframework.ws.client.support.interceptor.ClientInterceptor... interceptors)
Add additional
ClientInterceptors that should be used
with the WebServiceTemplate . |
WebServiceTemplateBuilder |
additionalInterceptors(Collection<? extends org.springframework.ws.client.support.interceptor.ClientInterceptor> interceptors)
Add additional
ClientInterceptors that should be used
with the WebServiceTemplate . |
WebServiceTemplateBuilder |
additionalMessageSenders(Collection<? extends org.springframework.ws.transport.WebServiceMessageSender> messageSenders)
Add additional
WebServiceMessageSenders that should
be used with the WebServiceTemplate . |
WebServiceTemplateBuilder |
additionalMessageSenders(org.springframework.ws.transport.WebServiceMessageSender... messageSenders)
Add additional
WebServiceMessageSenders that should
be used with the WebServiceTemplate . |
org.springframework.ws.client.core.WebServiceTemplate |
build()
Build a new
WebServiceTemplate instance and configure it using this
builder. |
<T extends org.springframework.ws.client.core.WebServiceTemplate> |
build(Class<T> webServiceTemplateClass)
Build a new
WebServiceTemplate instance of the specified type and configure
it using this builder. |
<T extends org.springframework.ws.client.core.WebServiceTemplate> |
configure(T webServiceTemplate)
Configure the provided
WebServiceTemplate instance using this builder. |
WebServiceTemplateBuilder |
customizers(Collection<? extends WebServiceTemplateCustomizer> customizers)
Set
WebServiceTemplateCustomizers that should
be applied to the WebServiceTemplate . |
WebServiceTemplateBuilder |
customizers(WebServiceTemplateCustomizer... customizers)
Set
WebServiceTemplateCustomizers that should
be applied to the WebServiceTemplate . |
WebServiceTemplateBuilder |
detectHttpMessageSender(boolean detectHttpMessageSender)
Set if a suitable HTTP-based
WebServiceMessageSender should be detected
based on the classpath. |
WebServiceTemplateBuilder |
interceptors(org.springframework.ws.client.support.interceptor.ClientInterceptor... interceptors)
Set the
ClientInterceptors that should be used with the
WebServiceTemplate . |
WebServiceTemplateBuilder |
interceptors(Collection<? extends org.springframework.ws.client.support.interceptor.ClientInterceptor> interceptors)
Set the
ClientInterceptors that should be used with the
WebServiceTemplate . |
WebServiceTemplateBuilder |
messageSenders(Collection<? extends org.springframework.ws.transport.WebServiceMessageSender> messageSenders)
Sets the
WebServiceMessageSenders that should be
used with the WebServiceTemplate . |
WebServiceTemplateBuilder |
messageSenders(org.springframework.ws.transport.WebServiceMessageSender... messageSenders)
Sets the
WebServiceMessageSenders that should be
used with the WebServiceTemplate . |
WebServiceTemplateBuilder |
setCheckConnectionForError(boolean checkConnectionForError)
Indicates whether the connection should be checked for error indicators
(
true ), or whether these should be ignored (false ). |
WebServiceTemplateBuilder |
setCheckConnectionForFault(boolean checkConnectionForFault)
Indicates whether the connection should be checked for fault indicators
(
true ), or whether we should rely on the message only (false ). |
WebServiceTemplateBuilder |
setDefaultUri(String defaultUri)
Set the default URI to be used on operations that do not have a URI parameter.
|
WebServiceTemplateBuilder |
setDestinationProvider(org.springframework.ws.client.support.destination.DestinationProvider destinationProvider)
Set the
DestinationProvider to use. |
WebServiceTemplateBuilder |
setFaultMessageResolver(org.springframework.ws.client.core.FaultMessageResolver faultMessageResolver)
Set the
FaultMessageResolver to use. |
WebServiceTemplateBuilder |
setMarshaller(Marshaller marshaller)
Set the
Marshaller to use to serialize messages. |
WebServiceTemplateBuilder |
setTransformerFactoryClass(Class<? extends TransformerFactory> transformerFactoryClass)
Set the
TransformerFactory implementation to use. |
WebServiceTemplateBuilder |
setUnmarshaller(Unmarshaller unmarshaller)
Set the
Unmarshaller to use to deserialize messages. |
WebServiceTemplateBuilder |
setWebServiceMessageFactory(org.springframework.ws.WebServiceMessageFactory messageFactory)
Sets the
WebServiceMessageFactory to use for creating messages. |
public WebServiceTemplateBuilder(WebServiceTemplateCustomizer... customizers)
public WebServiceTemplateBuilder detectHttpMessageSender(boolean detectHttpMessageSender)
WebServiceMessageSender
should be detected
based on the classpath. Default is true
.detectHttpMessageSender
- if a HTTP-based WebServiceMessageSender
should be detectedHttpWebServiceMessageSenderBuilder
public WebServiceTemplateBuilder messageSenders(org.springframework.ws.transport.WebServiceMessageSender... messageSenders)
WebServiceMessageSenders
that should be
used with the WebServiceTemplate
. Setting this value will replace any
previously defined message senders, including the HTTP-based message sender, if
any. Consider using additionalMessageSenders(WebServiceMessageSender...)
to keep it with user-defined message senders.messageSenders
- the message senders to setadditionalMessageSenders(WebServiceMessageSender...)
,
detectHttpMessageSender(boolean)
public WebServiceTemplateBuilder messageSenders(Collection<? extends org.springframework.ws.transport.WebServiceMessageSender> messageSenders)
WebServiceMessageSenders
that should be
used with the WebServiceTemplate
. Setting this value will replace any
previously defined message senders, including the HTTP-based message sender, if
any. Consider using additionalMessageSenders(Collection)
to keep it with
user-defined message senders.messageSenders
- the message senders to setadditionalMessageSenders(Collection)
,
detectHttpMessageSender(boolean)
public WebServiceTemplateBuilder additionalMessageSenders(org.springframework.ws.transport.WebServiceMessageSender... messageSenders)
WebServiceMessageSenders
that should
be used with the WebServiceTemplate
.messageSenders
- the message senders to addmessageSenders(WebServiceMessageSender...)
public WebServiceTemplateBuilder additionalMessageSenders(Collection<? extends org.springframework.ws.transport.WebServiceMessageSender> messageSenders)
WebServiceMessageSenders
that should
be used with the WebServiceTemplate
.messageSenders
- the message senders to addmessageSenders(Collection)
public WebServiceTemplateBuilder interceptors(org.springframework.ws.client.support.interceptor.ClientInterceptor... interceptors)
ClientInterceptors
that should be used with the
WebServiceTemplate
. Setting this value will replace any previously defined
interceptors.interceptors
- the interceptors to setadditionalInterceptors(ClientInterceptor...)
public WebServiceTemplateBuilder interceptors(Collection<? extends org.springframework.ws.client.support.interceptor.ClientInterceptor> interceptors)
ClientInterceptors
that should be used with the
WebServiceTemplate
. Setting this value will replace any previously defined
interceptors.interceptors
- the interceptors to setadditionalInterceptors(Collection)
public WebServiceTemplateBuilder additionalInterceptors(org.springframework.ws.client.support.interceptor.ClientInterceptor... interceptors)
ClientInterceptors
that should be used
with the WebServiceTemplate
.interceptors
- the interceptors to addinterceptors(ClientInterceptor...)
public WebServiceTemplateBuilder additionalInterceptors(Collection<? extends org.springframework.ws.client.support.interceptor.ClientInterceptor> interceptors)
ClientInterceptors
that should be used
with the WebServiceTemplate
.interceptors
- the interceptors to addinterceptors(Collection)
public WebServiceTemplateBuilder customizers(WebServiceTemplateCustomizer... customizers)
WebServiceTemplateCustomizers
that should
be applied to the WebServiceTemplate
. Customizers are applied in the order
that they were added after builder configuration has been applied. Setting this
value will replace any previously configured customizers.customizers
- the customizers to setadditionalCustomizers(WebServiceTemplateCustomizer...)
public WebServiceTemplateBuilder customizers(Collection<? extends WebServiceTemplateCustomizer> customizers)
WebServiceTemplateCustomizers
that should
be applied to the WebServiceTemplate
. Customizers are applied in the order
that they were added after builder configuration has been applied. Setting this
value will replace any previously configured customizers.customizers
- the customizers to setadditionalCustomizers(Collection)
public WebServiceTemplateBuilder additionalCustomizers(WebServiceTemplateCustomizer... customizers)
WebServiceTemplateCustomizers
that should be applied to the WebServiceTemplate
. Customizers are applied
in the order that they were added after builder configuration has been applied.customizers
- the customizers to addcustomizers(WebServiceTemplateCustomizer...)
public WebServiceTemplateBuilder additionalCustomizers(Collection<? extends WebServiceTemplateCustomizer> customizers)
WebServiceTemplateCustomizers
that should be applied to the WebServiceTemplate
. Customizers are applied
in the order that they were added after builder configuration has been applied.customizers
- the customizers to addcustomizers(Collection)
public WebServiceTemplateBuilder setCheckConnectionForFault(boolean checkConnectionForFault)
true
), or whether we should rely on the message only (false
).checkConnectionForFault
- whether to check for fault indicatorsWebServiceTemplate.setCheckConnectionForFault(boolean)
public WebServiceTemplateBuilder setCheckConnectionForError(boolean checkConnectionForError)
true
), or whether these should be ignored (false
).checkConnectionForError
- whether to check for error indicatorsWebServiceTemplate.setCheckConnectionForError(boolean)
public WebServiceTemplateBuilder setWebServiceMessageFactory(org.springframework.ws.WebServiceMessageFactory messageFactory)
WebServiceMessageFactory
to use for creating messages.messageFactory
- the message factory to use for creating messagesWebServiceAccessor.setMessageFactory(WebServiceMessageFactory)
public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller)
Unmarshaller
to use to deserialize messages.unmarshaller
- the message unmarshallerWebServiceTemplate.setUnmarshaller(Unmarshaller)
public WebServiceTemplateBuilder setMarshaller(Marshaller marshaller)
Marshaller
to use to serialize messages.marshaller
- the message marshallerWebServiceTemplate.setMarshaller(Marshaller)
public WebServiceTemplateBuilder setFaultMessageResolver(org.springframework.ws.client.core.FaultMessageResolver faultMessageResolver)
FaultMessageResolver
to use.faultMessageResolver
- the fault message resolver to useWebServiceTemplate.setFaultMessageResolver(FaultMessageResolver)
public WebServiceTemplateBuilder setTransformerFactoryClass(Class<? extends TransformerFactory> transformerFactoryClass)
TransformerFactory
implementation to use.transformerFactoryClass
- the transformer factory implementation to useTransformerObjectSupport.setTransformerFactoryClass(Class)
public WebServiceTemplateBuilder setDefaultUri(String defaultUri)
setDestinationProvider(DestinationProvider)
, but not both.defaultUri
- the destination provider URI to be used on operations that do not
have a URI parameter.setDestinationProvider(DestinationProvider)
public WebServiceTemplateBuilder setDestinationProvider(org.springframework.ws.client.support.destination.DestinationProvider destinationProvider)
DestinationProvider
to use. Typically, either this property is set,
or setDefaultUri(String)
, but not both.destinationProvider
- the destination provider to be used on operations that
do not have a URI parameter.WebServiceTemplate.setDestinationProvider(DestinationProvider)
public org.springframework.ws.client.core.WebServiceTemplate build()
WebServiceTemplate
instance and configure it using this
builder.WebServiceTemplate
instance.build(Class)
,
configure(WebServiceTemplate)
public <T extends org.springframework.ws.client.core.WebServiceTemplate> T build(Class<T> webServiceTemplateClass)
WebServiceTemplate
instance of the specified type and configure
it using this builder.T
- the type of web service templatewebServiceTemplateClass
- the template type to createWebServiceTemplate
instance.build()
,
configure(WebServiceTemplate)
public <T extends org.springframework.ws.client.core.WebServiceTemplate> T configure(T webServiceTemplate)
WebServiceTemplate
instance using this builder.T
- the type of web service templatewebServiceTemplate
- the WebServiceTemplate
to configurebuild()
,
build(Class)