diff --git a/src/reference/docbook/http.xml b/src/reference/docbook/http.xml index d9ef6bc8b8..3fdafb2bf5 100644 --- a/src/reference/docbook/http.xml +++ b/src/reference/docbook/http.xml @@ -14,15 +14,49 @@
Http Inbound Gateway - To receive messages over HTTP you need to use an HTTP inbound Channel Adapter or Gateway. In common with the HttpInvoker - support the HTTP inbound adapters need to be deployed within a servlet container. The easiest way to do this is to provide a servlet - definition in web.xml, see - for further details. Below is an example bean definition for a simple HTTP inbound endpoint. + To receive messages over HTTP, you need to use an HTTP Inbound + Channel Adapter or Gateway. To support + the HTTP Inbound Adapters, they need to be deployed + within a servlet container such as Apache Tomcat + or Jetty. The easiest + way to do this is to use Spring's + HttpRequestHandlerServlet, + by providing the following servlet definition in the web.xml file: + + + inboundGateway + o.s.web.context.support.HttpRequestHandlerServlet +]]> + + Notice that the servlet name matches the bean name. For more information + on using the HttpRequestHandlerServlet, see chapter + "Remoting and web services using Spring", + which is part of the Spring Framework Reference documentation. + + + If you are running within a Spring MVC application, then the aforementioned + explicit servlet definition is not necessary. In that case, the bean name + for your gateway can be matched against the URL path just like a Spring + MVC Controller bean. For more information, please see the chapter + "Web MVC framework", + which is part of the Spring Framework Reference documentation. + + + For a sample application and the corresponding configuration, please see the + Spring Integration Samples + repository. It contains the + Http Sample + application demonstrating Spring Integration's HTTP support. + + + Below is an example bean definition for a simple HTTP inbound endpoint. + ]]> + The HttpRequestHandlingMessagingGateway accepts a list of HttpMessageConverter instances or else relies on a default list. The converters allow customization of the mapping from HttpServletRequest to Message. The default converters @@ -246,7 +280,7 @@ In the case of the Outbound Gateway, the reply message produced by the gateway w 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. Most importantly, notice that the 'http-method' and 'expected-response-type' are provided. Those are two of the most commonly configured values. The - default http-method is POST, and the default response type is null. With a null response type, the payload of the reply Message would + default http-method is POST, and the default response type is null. With a null response type, the payload of the reply Message would contain the ResponseEntity as long as it's http status is a success (non-successful status codes will throw Exceptions). If you are expecting a different type, such as a String, then provide that fully-qualified class name as shown below. @@ -268,7 +302,7 @@ In the case of the Outbound Gateway, the reply message produced by the gateway w Beginning with Spring Integration 2.2 you can also determine the HTTP Method dynamically using SpEL and the http-method-expression attribute. Note that this attribute is obviously murually exclusive with http-method - You can also use expected-response-type-expression attribute instead of expected-response-type and + You can also use expected-response-type-expression attribute instead of expected-response-type and provide any valid SpEL expression that determines the type of the response.