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

	<bean id="port"
		  class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
		<property name="targetClass"
				  value="org.springframework.ws.transport.http.test.FreePortScanner"/>
		<property name="targetMethod" value="getFreePort"/>
	</bean>

	<bean id="httpServer"
		  class="org.springframework.ws.transport.http.SimpleHttpServerFactoryBean">
		<property name="port" ref="port"/>
		<property name="contexts">
			<map>
				<entry key="/service" value-ref="webServiceHandler"/>
			</map>
		</property>
	</bean>

	<bean id="webServiceHandler"
		  class="org.springframework.ws.transport.http.WebServiceMessageReceiverHttpHandler">
		<property name="chunkedEncoding" value="true"/>
		<property name="messageFactory" ref="messageFactory"/>
		<property name="messageReceiver" ref="messageDispatcher"/>
	</bean>

	<bean id="messageFactory"
		  class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>

	<bean id="messageDispatcher"
		  class="org.springframework.ws.soap.server.SoapMessageDispatcher">
		<property name="endpointMappings" ref="payloadMapping"/>
	</bean>

	<bean id="payloadMapping"
		  class="org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping">
		<property name="mappings">
			<props>
				<prop key="http://springframework.org/spring-ws/NoResponse">
					noResponseEndpoint
				</prop>
				<prop key="http://springframework.org/spring-ws/Response">
					responseEndpoint
				</prop>
				<prop key="http://springframework.org/spring-ws/Fault">faultEndpoint
				</prop>
			</props>
		</property>
	</bean>

	<bean id="noResponseEndpoint"
		  class="org.springframework.ws.transport.http.NoResponseEndpoint"/>

	<bean id="responseEndpoint"
		  class="org.springframework.ws.transport.http.ResponseEndpoint"/>

	<bean id="faultEndpoint"
		  class="org.springframework.ws.transport.http.FaultEndpoint"/>


</beans>
