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

	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
		destroy-method="close">
		<property name="driverClass" value="net.sourceforge.jtds.jdbc.Driver" />
		<property name="jdbcUrl" value="jdbc:jtds:sqlserver://172.16.48.128:1433/sitest" />
		<property name="user" value="sitest" />
		<property name="password" value="integration" />
	</bean>

	<int:channel id="functionRequestChannel" />
	<int:channel id="procedureRequestChannel" />
	<int:channel id="replyChannel" />

	<int:gateway id="gateway" default-request-timeout="5000"
		default-reply-timeout="5000" default-request-channel="functionRequestChannel"
		service-interface="org.springframework.integration.service.StringConversionService">
		<int:method name="convertToUpperCase" request-channel="procedureRequestChannel" />
		<int:method name="getNumber" request-channel="functionRequestChannel"
			payload-expression="new java.util.Date()" />
	</int:gateway>

	<int-jdbc:stored-proc-outbound-gateway
		id="outbound-gateway-procedure" request-channel="procedureRequestChannel"
		data-source="dataSource" stored-procedure-name="CAPITALIZE_STRING"
		expect-single-result="true">
		<int-jdbc:parameter name="INOUTSTRING" expression="payload" />
	</int-jdbc:stored-proc-outbound-gateway>

	<int-jdbc:stored-proc-outbound-gateway
		id="outbound-gateway-function" request-channel="functionRequestChannel"
		data-source="dataSource" stored-procedure-name="GET_COOL_NUMBER"
		is-function="true" expect-single-result="true">
	</int-jdbc:stored-proc-outbound-gateway>

</beans>
