<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration/ws"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:beans="http://www.springframework.org/schema/beans"
		xmlns:tool="http://www.springframework.org/schema/tool"
		xmlns:integration="http://www.springframework.org/schema/integration"
		targetNamespace="http://www.springframework.org/schema/integration/ws"
		elementFormDefault="qualified"
		attributeFormDefault="unqualified">

	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
	<xsd:import namespace="http://www.springframework.org/schema/integration"
			schemaLocation="http://www.springframework.org/schema/integration/spring-integration-2.1.xsd"/>

	<xsd:annotation>
		<xsd:documentation><![CDATA[
	Defines the configuration elements for Spring Integration's Web Service adapters.
		]]></xsd:documentation>
	</xsd:annotation>

	<xsd:element name="outbound-gateway">
		<xsd:complexType>
			<xsd:annotation>
				<xsd:documentation>
	Defines a Web Service based outbound Messaging Gateway.
				</xsd:documentation>
			</xsd:annotation>
			<xsd:sequence>
				<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="uri-variable" type="uriVariableType" minOccurs="0" maxOccurs="unbounded" />
			</xsd:sequence>
			<xsd:attribute name="id" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	A unique identifier for this Gateway.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="request-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	The channel where Messages should be sent to invoke the Web Service.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	The channel where Messages created from the Web Service responses will be sent.
	This is optional. However, if non-empty responses are expected and this is not set,
	then the request Messages must contain a REPLY_CHANNEL header.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="uri" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[
	The Destination URI for this Web Service Gateway. If the URI should be determined at runtime
	(e.g. registry lookup), then configure a 'destination-provider' reference instead. Aternatively,
	this URI may include {placeholders} whose values are determined by evaluating SpEL expressions
	provided via 'uri-variable' sub-elements. The root object for those evaluations is the actual
	request Message at runtime, i.e. you can access its payload or headers in the expression.
					]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
            <xsd:attribute name="destination-provider" type="xsd:string">
            	<xsd:annotation>
            		<xsd:documentation>
	Reference to a DestinationProvider implementation. Either provide this or a 'uri', never both.
	See org.springframework.ws.client.support.destination.DestinationProvider for more detail.
            		</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.client.support.destination.DestinationProvider"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>    
            </xsd:attribute>
            <xsd:attribute name="marshaller" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	Reference to a Spring OXM Mashaller. If the Marshaller instance also implements
	the Unmarshaller interface, then the 'unmarshaller' attribute is not required.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.oxm.Marshaller"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="unmarshaller" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	Reference to a Spring OXM Unmarshaller.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.oxm.Unmarshaller"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="ignore-empty-responses" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[
	Indicates whether empty String response payloads should be ignored. The default is TRUE.
	Set this to FALSE if you want to send empty String responses in reply Messages.
					]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="source-extractor" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	Reference to a Spring Web Services SourceExtractor.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.client.core.SourceExtractor"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="request-callback" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	Reference to a Spring Web Services WebServiceMessageCallback. This enables changing
	the Web Service request message after the payload has been written to it but prior
	to invocation of the actual Web Service. 
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.client.core.WebServiceMessageCallback"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="message-factory" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.WebServiceMessageFactory"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="fault-message-resolver" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.client.core.FaultMessageResolver"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="message-sender" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
						Reference to the bean definition of a WebServiceMessageSender.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.transport.WebServiceMessageSender"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="message-senders" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
						Reference to the bean definition for a list or array of WebServiceMessageSenders.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="interceptor" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
						Reference to the bean definition of a ClientInterceptor.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.ws.client.support.interceptor.ClientInterceptor"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="interceptors" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
						Reference to the bean definition for a list or array of ClientInterceptors.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="order" type="xsd:string"/>
			<xsd:attribute name="auto-startup" type="xsd:string" default="true"/>
			<xsd:attribute name="header-mapper">
				<xsd:annotation>
					<xsd:documentation>
						Reference to a HeaderMapper&lt;SoapHeader&gt; implementation
						that this gateway will use to map between Spring Integration
						MessageHeaders and the SoapHeader. 
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.mapping.HeaderMapper"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="mapped-request-headers" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[
	Comma-separated list of names of SOAP Headers to be mapped from the SOAP request into the MessageHeaders.
	This can only be provided if the 'header-mapper' reference is not being set directly. The values in
	this list can also be simple patterns to be matched against the header names (e.g. "foo*" or "*foo").
							]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="mapped-reply-headers" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[							
Comma-separated list of names of MessageHeaders to be mapped into the SOAP Headers of the SOAP reply.
This can only be provided if the 'header-mapper' reference is not being set directly. The values in
this list can also be simple patterns to be matched against the header names (e.g. "foo*" or "*foo").
						]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="uriVariableType">
		<xsd:annotation>
			<xsd:documentation><![CDATA[
				Expression to be evaluated against the Message to replace a URI {placeholder} with the evaluation result.
			]]></xsd:documentation>
		</xsd:annotation>
		<xsd:attribute name="name" use="required">
			<xsd:annotation>
				<xsd:documentation><![CDATA[
					Name of the placeholder to be replaced.
				]]></xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="expression" use="required">
			<xsd:annotation>
				<xsd:documentation><![CDATA[
					Expression to be evaluated to determine the replacement value.
					The Message is the root object of the expression, therefore
					the 'payload' and 'headers' are available directly. Any bean
					may be resolved if the bean name is preceded with '@'.
				]]></xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:element name="inbound-gateway">
		<xsd:complexType>
			<xsd:annotation>
				<xsd:documentation>
	Defines a Web Service based inbound Messaging Gateway.
				</xsd:documentation>
			</xsd:annotation>
			<xsd:attribute name="id" type="xsd:string"/>
			<xsd:attribute name="request-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-timeout" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
	Maximum time in milliseconds to wait for a reply from the downstream message flow initiated by this gateway.
	This attribute is only relevant if at least some part of the downstream flow is asynchronous.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="error-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
						If a (synchronous) downstream exception is thrown and an error-channel is specified,
						the MessagingException will be sent to this channel. 
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="marshaller" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.oxm.Marshaller"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="unmarshaller" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.oxm.Unmarshaller"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="extract-payload" type="xsd:string"/>
			<xsd:attribute name="header-mapper">
				<xsd:annotation>
					<xsd:documentation>
						Reference to a HeaderMapper&lt;SoapHeader&gt; implementation
						that this gateway will use to map between Spring Integration
						MessageHeaders and the SoapHeader. 
					</xsd:documentation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.mapping.HeaderMapper"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="mapped-request-headers" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[
	Comma-separated list of names of SOAP Headers to be mapped from the SOAP request into the MessageHeaders.
	This can only be provided if the 'header-mapper' reference is not being set directly. The values in
	this list can also be simple patterns to be matched against the header names (e.g. "foo*" or "*foo").
							]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="mapped-reply-headers" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation><![CDATA[							
Comma-separated list of names of MessageHeaders to be mapped into the SOAP Headers of the SOAP reply.
This can only be provided if the 'header-mapper' reference is not being set directly. The values in
this list can also be simple patterns to be matched against the header names (e.g. "foo*" or "*foo").
						]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="header-enricher">
		<xsd:complexType>
			<xsd:annotation>
				<xsd:documentation>
	Defines a Transformer for adding a SOAP Action value.
				</xsd:documentation>
			</xsd:annotation>
			<xsd:complexContent>
				<xsd:extension base="transformerType">
					<xsd:choice minOccurs="1" maxOccurs="1">
						<xsd:element name="soap-action" type="headerType"/>
					</xsd:choice>
					<xsd:attribute name="default-overwrite">
						<xsd:annotation>
							<xsd:documentation>
	Specify the default boolean value for whether to overwrite existing header values. This will only take effect for
	sub-elements that do not provide their own 'overwrite' attribute. If the 'default-overwrite' attribute is not
	provided, then the specified header values will NOT overwrite any existing ones with the same header names. 
							</xsd:documentation>
						</xsd:annotation>
						<xsd:simpleType>
							<xsd:union memberTypes="xsd:boolean xsd:string"/>
						</xsd:simpleType> 
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="headerType">
		<xsd:attribute name="value" type="xsd:string" />
		<xsd:attribute name="ref" type="xsd:string" />
		<xsd:attribute name="expression" type="xsd:string" />
		<xsd:attribute name="overwrite">
			<xsd:annotation>
				<xsd:documentation>
	Boolean value to indicate whether this header value should overwrite an existing header value for the same name.
				</xsd:documentation>
			</xsd:annotation>
			<xsd:simpleType>
				<xsd:union memberTypes="xsd:boolean xsd:string"/>
			</xsd:simpleType>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:complexType name="transformerType">
		<xsd:attribute name="id" type="xsd:string"/>
		<xsd:attribute name="input-channel" type="xsd:string">
			<xsd:annotation>
				<xsd:appinfo>
					<tool:annotation kind="ref">
						<tool:expected-type type="org.springframework.integration.MessageChannel"/>
					</tool:annotation>
				</xsd:appinfo>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="output-channel" type="xsd:string">
			<xsd:annotation>
				<xsd:appinfo>
					<tool:annotation kind="ref">
						<tool:expected-type type="org.springframework.integration.MessageChannel"/>
					</tool:annotation>
				</xsd:appinfo>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

</xsd:schema>
