To invoke a Web Service upon sending a message to a channel, there are two options - both of which build
upon the Spring Web Services
project: SimpleWebServiceOutboundGateway
and
MarshallingWebServiceOutboundGateway
. The former will accept either a
String
or javax.xml.transform.Source
as the message
payload. The latter provides support for any implementation of the Marshaller
and Unmarshaller
interfaces. Both require a Spring Web Services
DestinationProvider
for determining the URI of the Web Service to be
called.
simpleGateway = new SimpleWebServiceOutboundGateway(destinationProvider); marshallingGateway = new MarshallingWebServiceOutboundGateway(destinationProvider, marshaller);
Note | |
---|---|
When using the namespace support described below, you will only need to set a URI. Internally, the parser will configure a fixed URI DestinationProvider implementation. If you do need dynamic resolution of the URI at runtime, however, then the DestinationProvider can provide such behavior as looking up the URI from a registry. See the Spring Web Services javadoc for more information about the DestinationProvider strategy. |
For more detail on the inner workings, see the Spring Web Services reference guide's chapter covering client access as well as the chapter covering Object/XML mapping.