Spring Web Services Framework

org.springframework.ws.client.core.support
Class WebServiceGatewaySupport

java.lang.Object
  extended by org.springframework.ws.client.core.support.WebServiceGatewaySupport
All Implemented Interfaces:
InitializingBean

public abstract class WebServiceGatewaySupport
extends Object
implements InitializingBean

Convenient super class for application classes that need Web service access.

Requires a WebServiceMessageFactory or a WebServiceTemplate instance to be set. It will create its own WebServiceTemplate if WebServiceMessageFactory is passed in.

In addition to the message factory property, this gateway offers Marshaller and Unmarshaller properties. Setting these is required when the marshalling methods of the template are to be used.

Note that when injecting a WebServiceTemplate directly, the convenience setters (setMarshaller(Marshaller), setUnmarshaller(Unmarshaller), setMessageSender(WebServiceMessageSender), setMessageSenders(WebServiceMessageSender[]), and setDefaultUri(String)) should not be used on this class, but on the template directly.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
setMessageFactory(WebServiceMessageFactory), WebServiceTemplate, setMarshaller(Marshaller)

Field Summary
protected  Log logger
          Logger available to subclasses.
 
Constructor Summary
protected WebServiceGatewaySupport()
          Creates a new instance of the WebServiceGatewaySupport class, with a default WebServiceTemplate.
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory)
          Creates a new WebServiceGatewaySupport instance based on the given message factory.
 
Method Summary
 void afterPropertiesSet()
           
 String getDefaultUri()
          Returns the default URI used by the gateway.
 DestinationProvider getDestinationProvider()
          Returns the destination provider used by the gateway.
 ClientInterceptor[] getInterceptors()
          Returns the ClientInterceptors used by the template.
 org.springframework.oxm.Marshaller getMarshaller()
          Returns the Marshaller used by the gateway.
 WebServiceMessageFactory getMessageFactory()
          Returns the WebServiceMessageFactory used by the gateway.
 WebServiceMessageSender[] getMessageSenders()
          Returns the WebServiceMessageSenders used by the gateway.
 org.springframework.oxm.Unmarshaller getUnmarshaller()
          Returns the Unmarshaller used by the gateway.
 WebServiceTemplate getWebServiceTemplate()
          Returns the WebServiceTemplate for the gateway.
protected  void initGateway()
          Subclasses can override this for custom initialization behavior.
 void setDefaultUri(String uri)
          Sets the default URI used by the gateway.
 void setDestinationProvider(DestinationProvider destinationProvider)
          Set the destination provider URI used by the gateway.
 void setInterceptors(ClientInterceptor[] interceptors)
          Sets the ClientInterceptors used by the gateway.
 void setMarshaller(org.springframework.oxm.Marshaller marshaller)
          Sets the Marshaller used by the gateway.
 void setMessageFactory(WebServiceMessageFactory messageFactory)
          Set the WebServiceMessageFactory to be used by the gateway.
 void setMessageSender(WebServiceMessageSender messageSender)
          Sets a single WebServiceMessageSender to be used by the gateway.
 void setMessageSenders(WebServiceMessageSender[] messageSenders)
          Sets multiple WebServiceMessageSender to be used by the gateway.
 void setUnmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
          Sets the Unmarshaller used by the gateway.
 void setWebServiceTemplate(WebServiceTemplate webServiceTemplate)
          Sets the WebServiceTemplate to be used by the gateway.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Logger available to subclasses.

Constructor Detail

WebServiceGatewaySupport

protected WebServiceGatewaySupport()
Creates a new instance of the WebServiceGatewaySupport class, with a default WebServiceTemplate.


WebServiceGatewaySupport

protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory)
Creates a new WebServiceGatewaySupport instance based on the given message factory.

Parameters:
messageFactory - the message factory to use
Method Detail

getMessageFactory

public final WebServiceMessageFactory getMessageFactory()
Returns the WebServiceMessageFactory used by the gateway.


setMessageFactory

public final void setMessageFactory(WebServiceMessageFactory messageFactory)
Set the WebServiceMessageFactory to be used by the gateway.


getDefaultUri

public final String getDefaultUri()
Returns the default URI used by the gateway.


setDefaultUri

public final void setDefaultUri(String uri)
Sets the default URI used by the gateway.


getDestinationProvider

public final DestinationProvider getDestinationProvider()
Returns the destination provider used by the gateway.


setDestinationProvider

public final void setDestinationProvider(DestinationProvider destinationProvider)
Set the destination provider URI used by the gateway.


setMessageSender

public final void setMessageSender(WebServiceMessageSender messageSender)
Sets a single WebServiceMessageSender to be used by the gateway.


getMessageSenders

public final WebServiceMessageSender[] getMessageSenders()
Returns the WebServiceMessageSenders used by the gateway.


setMessageSenders

public final void setMessageSenders(WebServiceMessageSender[] messageSenders)
Sets multiple WebServiceMessageSender to be used by the gateway.


getWebServiceTemplate

public final WebServiceTemplate getWebServiceTemplate()
Returns the WebServiceTemplate for the gateway.


setWebServiceTemplate

public final void setWebServiceTemplate(WebServiceTemplate webServiceTemplate)
Sets the WebServiceTemplate to be used by the gateway.

When using this property, the convenience setters (setMarshaller(Marshaller), setUnmarshaller(Unmarshaller), setMessageSender(WebServiceMessageSender), setMessageSenders(WebServiceMessageSender[]), and setDefaultUri(String)) should not be set on this class, but on the template directly.


getMarshaller

public final org.springframework.oxm.Marshaller getMarshaller()
Returns the Marshaller used by the gateway.


setMarshaller

public final void setMarshaller(org.springframework.oxm.Marshaller marshaller)
Sets the Marshaller used by the gateway. Setting this property is only required if the marshalling functionality of WebServiceTemplate is to be used.

See Also:
WebServiceTemplate.marshalSendAndReceive(java.lang.Object)

getUnmarshaller

public final org.springframework.oxm.Unmarshaller getUnmarshaller()
Returns the Unmarshaller used by the gateway.


setUnmarshaller

public final void setUnmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
Sets the Unmarshaller used by the gateway. Setting this property is only required if the marshalling functionality of WebServiceTemplate is to be used.

See Also:
WebServiceTemplate.marshalSendAndReceive(java.lang.Object)

getInterceptors

public final ClientInterceptor[] getInterceptors()
Returns the ClientInterceptors used by the template.


setInterceptors

public final void setInterceptors(ClientInterceptor[] interceptors)
Sets the ClientInterceptors used by the gateway.


afterPropertiesSet

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

initGateway

protected void initGateway()
                    throws Exception
Subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.

Throws:
Exception - if initialization fails

Spring Web Services Framework

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