<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:int="http://www.springframework.org/schema/integration"
	   xmlns:int-http="http://www.springframework.org/schema/integration/http"
	   xsi:schemaLocation="http://www.springframework.org/schema/integration/http
	    https://www.springframework.org/schema/integration/http/spring-integration-http.xsd
		http://www.springframework.org/schema/integration
		https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/beans
		https://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="restTemplate" class="org.springframework.web.client.RestTemplate"/>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   rest-template="restTemplate"
							   request-channel="requestChannel"
							   reply-channel="replyChannel"/>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   rest-template="restTemplate"
							   request-channel="resTypeSetChannel"
							   reply-channel="replyChannel"
							   expected-response-type="java.lang.String"/>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   rest-template="restTemplate"
							   request-channel="resPrimitiveStringPresentationChannel"
							   reply-channel="replyChannel"
							   expected-response-type="[B"/>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   rest-template="restTemplate"
							   request-channel="resTypeExpressionSetChannel"
							   reply-channel="replyChannel"
							   expected-response-type-expression="payload"/>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   rest-template="restTemplateWithConverters"
							   request-channel="resTypeExpressionSetSerializationChannel"
							   reply-channel="replyChannel"
							   expected-response-type-expression="payload"/>

	<bean id="restTemplateWithConverters" class="org.springframework.web.client.RestTemplate">
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.integration.http.converter.SerializingHttpMessageConverter"/>
				<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
			</list>
		</property>
	</bean>

	<int-http:outbound-gateway url="/testApps/outboundResponse"
							   request-channel="invalidResponseTypeChannel"
							   expected-response-type-expression="new java.util.Date()"/>

	<int:chain input-channel="contentTypePropagationChannel" output-channel="nullChannel">
		<int:object-to-json-transformer/>
		<int-http:outbound-gateway url="/testApps/outboundResponse" rest-template="restTemplate"/>
	</int:chain>

	<int:channel id="replyChannel">
		<int:queue/>
	</int:channel>

</beans>
