INT-590 some last minute polishings
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
|
||||
<chapter id="http">
|
||||
<title>Http Support</title>
|
||||
<title>HTTP Support</title>
|
||||
|
||||
<section id="http-intro">
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
The Http support allows for the making of Http requests and the processing of inbound Http requests. Because HTTP is always
|
||||
request repsonse even if all that is returned is a 200 status code the Http support consists of two gateway implementations
|
||||
<classname>HttpInboundEndpoint</classname> and <classname>HttpOutboundEndpoint</classname>.
|
||||
The HTTP support allows for the making of HTTP requests and the processing of inbound Http requests. Because interaction HTTP is always synchronous, even if all that is returned is a 200 status code the Http support consists of two gateway implementations
|
||||
<classname>HttpInboundEndpoint</classname> and <classname>HttpOutboundEndpoint</classname>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="http-inbound">
|
||||
<title>Http Inbound Gateway</title>
|
||||
<para>
|
||||
To receive messages over http you need to use an <classname>HttpInboundGateway</classname>. In common with the HttpInvoker
|
||||
To receive messages over http you need to use an <classname>HttpInboundEndpoint</classname>. In common with the HttpInvoker
|
||||
support the Http Inbound Gateway needs to be deployed within a servlet container. The easiest way to do this is to provide a servlet
|
||||
definition in <emphasis>web.xml</emphasis>, see
|
||||
<xref linkend="httpinvoker-inbound"/> for further details. Below is an example bean defintion for a simple <classname>HttpInboundEndpoint</classname>
|
||||
@@ -23,7 +22,7 @@
|
||||
<property name="requestChannel" ref="httpRequestChannel" />
|
||||
<property name="replyChannel" ref="httpReplyChannel" />
|
||||
</bean>]]></programlisting>
|
||||
The <classname>HttpInboundGateway</classname> accepts an instance of <interfacename>InboundRequestMapper</interfacename> which allows
|
||||
The <classname>HttpInboundEndpoint</classname> accepts an instance of <interfacename>InboundRequestMapper</interfacename> which allows
|
||||
customisation of the mapping from <interfacename>HttpServletRequest</interfacename> to <interfacename>Message</interfacename>. If none is
|
||||
provided the an instance of <classname>DefaultInboundRequestMapper</classname> will be used. This encapsualtes a simple strategy, which for
|
||||
example will create a String message for a <emphasis>POST</emphasis> request where the content type starts with "text", see the Javadoc for
|
||||
@@ -33,7 +32,7 @@
|
||||
In sending a response to the client there are a number of ways to customise the behaviour of the gateway. By default the gateway will
|
||||
simply acknowledge that the request was received by sending a 200 status code back. It is possible to customise this response by providing an
|
||||
implementation of the Spring MVC <interfacename>View</interfacename> which will be invoked with the created <interfacename>Message</interfacename>.
|
||||
In the case that the gateway should expect a reply to the <interfacename>Message</interfacename> then setting the expectReply flag will cause
|
||||
In the case that the gateway should expect a reply to the <interfacename>Message</interfacename> then setting the <property>expectReply</property> flag will cause
|
||||
the gateway to wait for a reponse <interfacename>Message</interfacename> before creating a Http response. Below is an example of a gateway
|
||||
configured to use a custom view and to wait for a response. It also shows how to customise the Http methods accepted by the gateway, which
|
||||
are <emphasis>POST</emphasis> and <emphasis>GET</emphasis> by default.
|
||||
@@ -59,7 +58,7 @@
|
||||
<title>Http Outbound Gateway</title>
|
||||
|
||||
<para>
|
||||
To configure the <classname>HttpOutboundGateway</classname> write a bean definition like this:
|
||||
To configure the <classname>HttpOutboundEndpoint</classname> write a bean definition like this:
|
||||
<programlisting language="xml"><![CDATA[<bean id="httpOutbound" class="org.springframework.integration.http.HttpOutboundEndpoint" >
|
||||
<property name="outputChannel" ref="responseChannel" />
|
||||
</bean>]]></programlisting>
|
||||
@@ -94,8 +93,7 @@ By default the Http request will be made using an instance of <classname>SimpleH
|
||||
</para>
|
||||
<para>
|
||||
To configure an inbound http gateway which expects a response.
|
||||
<programlisting language="xml"><![CDATA[<http:inbound-gateway id="inboundGateway" request-channel="requests"
|
||||
reply-channel="responses" />]]></programlisting>
|
||||
<programlisting language="xml"><![CDATA[<http:inbound-gateway id="inboundGateway" request-channel="requests" reply-channel="responses"/>]]></programlisting>
|
||||
</para>
|
||||
<para>
|
||||
To configure the outbound gateway you can use the namespace support as well. The following code snippet shows the different configuration options for an outbound Http gateway.
|
||||
|
||||
Reference in New Issue
Block a user