<?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"
	xmlns:oxm="http://www.springframework.org/schema/oxm"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/http https://www.springframework.org/schema/integration/http/spring-integration-http.xsd
		http://www.springframework.org/schema/oxm https://www.springframework.org/schema/oxm/spring-oxm.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">


	<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
				<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
					<property name="marshaller" ref="marshaller"/>
					<property name="unmarshaller" ref="marshaller"/>
				</bean>
				<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
					<property name="objectMapper" ref="jaxbJacksonObjectMapper"/>
				</bean>
			</list>
		</property>
	</bean>

	<context:component-scan base-package="org.springframework.integration.samples.rest"/>

	<oxm:jaxb2-marshaller id="marshaller" context-path="org.springframework.integration.samples.rest.domain" />

	<bean id="jaxbJacksonObjectMapper" class="org.springframework.integration.samples.rest.json.JaxbJacksonObjectMapper"/>

</beans>
