22.4 Http Namespace Support

Spring Integration provides an "http" namespace and schema definition. To include it in your configuration, simply provide the following URI within a namespace declaration: 'http://www.springframework.org/schema/integration/http'. The schema location should then map to 'http://www.springframework.org/schema/integration/http/spring-integration-http-1.0.xsd'.

To configure an inbound http channel adapter which is an instance of HttpInboundEndpoint configured not to expect a response.

 <http:inbound-channel-adapter id="httpChannelAdapter" channel="requests" supported-methods="PUT, DELETE"/>

To configure an inbound http gateway which expects a response.

 <http:inbound-gateway id="inboundGateway" request-channel="requests" reply-channel="responses"/>

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.

<http:outbound-gateway id="fullConfigWithoutMapper"
		request-channel="requests"
		default-url="http://localhost/test"
		extract-request-payload="false"
		charset="UTF-8"
		request-executor="executor"
		request-timeout="1234"
		reply-channel="replies"/>

If you want to provide a custom OutboundRequestMapper, then a reference may be supplied to the 'request-mapper' attribute. In that case however you will not be allowed to set the default URL, charset, and 'extract-request-payload' properties since those are all properties of the default mapper (see the JavaDoc for DefaultOutboundRequestMapper for more information).