INT-676 included discussion about WS DestinationProvider and the ignore-empty-responses flag

This commit is contained in:
Mark Fisher
2009-07-04 23:47:12 +00:00
parent 3c127fcf72
commit 0bcaedcf08
3 changed files with 41 additions and 9 deletions

View File

@@ -3,6 +3,8 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<bookinfo>
<title>Spring Integration Reference Manual</title>
<titleabbrev>Spring Integration 1.0.3</titleabbrev>
<productname>Spring Integration</productname>
<releaseinfo>1.0.3</releaseinfo>

View File

@@ -85,11 +85,9 @@
<para>
If you need to serialize an Object to a byte array or deserialize a byte array back into an Object,
Spring Integration provides symmetrical serialization transformers.
<programlisting language="xml"><![CDATA[ <payload-serializing-transformer input-channel="objectsIn"
output-channel="bytesOut"/>
<programlisting language="xml"><![CDATA[ <payload-serializing-transformer input-channel="objectsIn" output-channel="bytesOut"/>
<payload-deserializing-transformer input-channel="bytesIn"
output-channel="objectsOut"/>]]></programlisting>
<payload-deserializing-transformer input-channel="bytesIn" output-channel="objectsOut"/>]]></programlisting>
</para>
<para>
If you only need to add headers to a Message, and they are not dynamically determined by Message content,

View File

@@ -12,11 +12,20 @@
<classname>MarshallingWebServiceOutboundGateway</classname>. The former will accept either a
<classname>String</classname> or <interfacename>javax.xml.transform.Source</interfacename> as the message
payload. The latter provides support for any implementation of the <interfacename>Marshaller</interfacename>
and <interfacename>Unmarshaller</interfacename> interfaces. Both require the URI of the Web Service to be
called.<programlisting language="java"> simpleGateway = new SimpleWebServiceOutboundGateway(uri);
and <interfacename>Unmarshaller</interfacename> interfaces. Both require a Spring Web Services
<interfacename>DestinationProvider</interfacename> for determining the URI of the Web Service to be
called.<programlisting language="java"> simpleGateway = new SimpleWebServiceOutboundGateway(destinationProvider);
marshallingGateway = new MarshallingWebServiceOutboundGateway(uri, marshaller);
marshallingGateway = new MarshallingWebServiceOutboundGateway(destinationProvider, marshaller);
</programlisting>
<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
<ulink url="http://static.springsource.org/spring-ws/sites/1.5/apidocs/index.html">javadoc</ulink> for
more information about the DestinationProvider strategy.
</note>
</para>
<para>
For more detail on the inner workings, see the Spring Web Services reference guide's chapter covering
@@ -37,7 +46,7 @@
If the incoming web service message is a SOAP message the SOAP Action header will be added to the headers of the
<classname>Message</classname> that is forwarded onto the request channel.
<programlisting language="java"> simpleGateway = new SimpleWebServiceInboundGateway(uri);
<programlisting language="java"> simpleGateway = new SimpleWebServiceInboundGateway();
simpleGateway.setRequestChannel(forwardOntoThisChannel);
simpleGateway.setReplyChannel(listenForResponseHere); //Optional
@@ -62,7 +71,25 @@ as per standard Spring Web Services configuration.
<programlisting language="xml"><![CDATA[<ws:outbound-gateway id="simpleGateway"
request-channel="inputChannel"
uri="http://example.org"/>]]></programlisting>
<note>
Notice that this example does not provide a 'reply-channel'. If the Web Service were to
return a non-empty response, the Message containing that response would be sent to the
reply channel provided in the request Message's REPLY_CHANNEL header, and if that were
not available a channel resolution Exception would be thrown. If you want to send the
reply to another channel instead, then provide a 'reply-channel' attribute on the
'outbound-gateway' element.
</note>
<tip>
When invoking a Web Service that returns an empty response after using a String payload
for the request Message, <emphasis>no reply Message will be sent by default</emphasis>.
Therefore you don't need to set a 'reply-channel' or have a REPLY_CHANNEL header in the
request Message. If for any reason you actually <emphasis>do</emphasis> want to receive
the empty response as a Message, then provide the 'ignore-empty-responses' attribute with
a value of <emphasis>false</emphasis> (this only applies for Strings, because using a
Source or Document object simply leads to a NULL response and will therefore
<emphasis>never</emphasis> generate a reply Message).
</tip>
To set up an inbound Web Service Gateway, use the "inbound-gateway":
<programlisting language="xml"><![CDATA[<ws:inbound-gateway id="simpleGateway"
request-channel="inputChannel"/>]]></programlisting>
@@ -87,6 +114,11 @@ as per standard Spring Web Services configuration.
you may also provide a reference for the "request-callback" on the outbound gateways.
</note>
</para>
<para>
For either outbound gateway type, a "destination-provider" attribute can be specified instead of the "uri"
(exactly one of them is required). You can then reference any Spring Web Services DestinationProvider
implementation (e.g. to lookup the URI at runtime from a registry).
</para>
<para>
For either outbound gateway type, the "message-factory" attribute can also be configured with a reference to any
Spring Web Services <interfacename>WebServiceMessageFactory</interfacename> implementation.