<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://www.mulesource.org/schema/mule/cxf/2.2"
            xmlns:cxf="http://cxf.apache.org/core"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.2"
            xmlns:schemadoc="http://www.mulesource.org/schema/mule/schemadoc/2.2"
            xmlns:beans="http://www.springframework.org/schema/beans"
            targetNamespace="http://www.mulesource.org/schema/mule/cxf/2.2"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
    <xsd:import namespace="http://www.springframework.org/schema/beans"
                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.2"
                schemaLocation="http://www.mulesource.org/schema/mule/core/2.2/mule.xsd"/>
    <xsd:import namespace="http://cxf.apache.org/core"
                schemaLocation="http://cxf.apache.org/schemas/core.xsd"/>
    <xsd:import namespace = "http://www.mulesource.org/schema/mule/schemadoc/2.2"
                schemaLocation = "http://www.mulesource.org/schema/mule/schemadoc/2.2/mule-schemadoc.xsd"/>

    <xsd:annotation>
        <xsd:documentation>
            Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. The Mule CXF Transport is an evolution of Mule's XFire transport, which provided support for the use of web service integration via Apache CXF. The Mule CXF connector also provides support for WS-Security, WS-Addressing, and WS-Reliable-Messaging.
        </xsd:documentation>
        
        <xsd:appinfo>
            <schemadoc:short-name>CXF</schemadoc:short-name>
            <schemadoc:page-title>CXF Transport</schemadoc:page-title>

            <schemadoc:transport-features receiveEvents="true" dispatchEvents="true" responseEvents="true"
                                          requestEvents="true"
                                          transactions="false" streaming="true">
                <schemadoc:inboundMEPs in-only="true" in-out="true" in-optional-out="true"/>
                <schemadoc:outboundMEPs out-only="true" out-in="true" out-optional-in="true"/>
            </schemadoc:transport-features>
        </xsd:appinfo>
    </xsd:annotation>

    <xsd:element name="connector" type="cxfConnectorType" substitutionGroup="mule:abstract-connector"/>
    <xsd:complexType name="cxfConnectorType">
        <xsd:complexContent>
            <xsd:extension base="mule:connectorType">
                <xsd:attribute name="defaultFrontend" type="xsd:string" default="jaxws">
                   <xsd:annotation>
                        <xsd:documentation>
                            The CXF frontend that is used to build an internal service representation from your Java classes. The default is "jaxws". The "simple" frontend is also supported.  
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="configurationLocation" type="xsd:string">
                    <xsd:annotation>
                         <xsd:documentation>
                             The location of a CXF configuration file, if any needs to be supplied.
                         </xsd:documentation>
                     </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="initializeStaticBusInstance" type="mule:substitutableBoolean" default="true">
                    <xsd:annotation>
                         <xsd:documentation>
                             Initialize the static CXF Bus with a Bus configured to use Mule for all transports. This will affect any CXF generated clients that you run standalone. Defaults to true.
                         </xsd:documentation>
                     </xsd:annotation>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
    <xsd:complexType name="inboundEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:inboundEndpointType">
                <xsd:group ref="endpointElements"/>
                <xsd:attributeGroup ref="inboundEndpointAttributes"/>
                <xsd:attributeGroup ref="commonEndpointAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="outbound-endpoint" type="outboundEndpointType"
                 substitutionGroup="mule:abstract-outbound-endpoint"/>

    <xsd:complexType name="outboundEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:outboundEndpointType">
                <xsd:group ref="endpointElements"/>
                <xsd:attributeGroup ref="outboundEndpointAttributes"/>
                <xsd:attributeGroup ref="commonEndpointAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>

    <xsd:complexType name="globalEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:globalEndpointType">
                <xsd:group ref="endpointElements"/>
                <xsd:attributeGroup ref="inboundEndpointAttributes"/>
                <xsd:attributeGroup ref="outboundEndpointAttributes"/>
                <xsd:attributeGroup ref="commonEndpointAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:attributeGroup name="commonEndpointAttributes">
        <xsd:attribute name="proxy" type="mule:substitutableBoolean">
            <xsd:annotation>
                <xsd:documentation>
                    Whether or not this outbound endpoint is acting as a web service proxy. If so, it will expect raw xml as the input parameter and return an XML stream as the output.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="payload">
            <xsd:annotation>
                <xsd:documentation>
                    Whether the whole SOAP Envelope, or just the body contents should be sent when in proxy mode.  
                </xsd:documentation>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:NMTOKEN">
                    <xsd:enumeration value="envelope"/>
                    <xsd:enumeration value="body"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="soapVersion">
            <xsd:annotation>
                <xsd:documentation>
                    The soapVersion that is going to be used for this endpoint. The specified version is translated into the corresponding bindingId value. This attribute is useful when there's need to avoid the creation of the endpoint with the default binding.
                    In case the bindingId attribute is set this attribute will override it. If not set and not specified otherwise CXF defaults to SOAP 1.1 binding
                </xsd:documentation>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:NMTOKEN">
                    <xsd:enumeration value="1.1"/>
                    <xsd:enumeration value="1.2"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="mtomEnabled" type="mule:substitutableBoolean">
            <xsd:annotation>
                <xsd:documentation>
                    Whether or not MTOM (attachment support) is enabled for this endpoint.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="wsdlLocation" type="xsd:string" >
            <xsd:annotation>
                <xsd:documentation>
                    The location of the WSDL for your service. If this is a server side endpoint it will served to your users.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="protocolConnector" type="xsd:string" >
            <xsd:annotation>
                <xsd:documentation>
                            The name of the connector that you wish to use to send/receive messages on with CXF. (As of 2.1)
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="applyTransformersToProtocol" type="mule:substitutableBoolean" default="true">
            <xsd:annotation>
                <xsd:documentation>
                    Whether to apply the transformers to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="enableMuleSoapHeaders" type="mule:substitutableBoolean" default="true">
            <xsd:annotation>
                <xsd:documentation>
                    Whether or not this endpoint should write Mule SOAP headers which pass along the correlation and ReplyTo information. This is true by default, but the Mule SOAP headers are only triggered in situations where there is an existing correlation ID and the ReplyTo header is set. (As of 2.2.1)
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="serviceClass" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The class CXF should use to construct its service model. This is optional, and by default it will use the implementation class of your component, on inbound cxf endpoint. But it is mandatory for outbound endpoint when using "aegis" frontend. 
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="frontend">
            <xsd:annotation>
                <xsd:documentation>
                    The CXF frontend that is used to build an internal service representation from your Java classes. The default is "jaxws". The "simple" and "aegis" frontend are also supported.  
                </xsd:documentation>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:NMTOKEN">
                    <xsd:enumeration value="jaxws"/>
                    <xsd:enumeration value="simple"/>
                    <xsd:enumeration value="aegis"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:attributeGroup>

    <xsd:attributeGroup name="inboundEndpointAttributes">
        <xsd:attribute name="bindingUri" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The binding that should be used for this service. It defaults to the SOAP binding by default.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="endpointName" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The WSDL endpoint name of your service.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="namespace" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The service namespace. (As of 2.2.1)
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="serviceName" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The WSDL service name of your service.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="applyFiltersToProtocol" type="mule:substitutableBoolean" default="true">
            <xsd:annotation>
                <xsd:documentation>
                    Whether to apply the filters to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="applySecurityToProtocol" type="mule:substitutableBoolean" default="true">
            <xsd:annotation>
                <xsd:documentation>
                    Whether to apply the security filter to the protocol endpoint. Defaults to true for Mule 2.2+ and false for 2.1 and previous versions.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:attributeGroup>

    <xsd:group name="endpointElements">
        <xsd:sequence>
            <xsd:element name="databinding" type="databindingType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        The databinding implementation that should be used. By default, this is JAXB for the JAX-WS frontend and Aegis for the simple frontend. This should be specified in the form of a Spring bean.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="features" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Any CXF features you want to apply to the client/server. See the CXF documentation for more information on features.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="inInterceptors" type="interceptors" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Additional incoming interceptors for this service.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="inFaultInterceptors" type="interceptors" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Additional incoming fault interceptors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="outInterceptors" type="interceptors" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Additional outgoing interceptors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="outFaultInterceptors" type="interceptors" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Additional outgoing fault interceptors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:attributeGroup name="outboundEndpointAttributes">
        <xsd:attribute name="wsdlPort" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The WSDL port you want to use to communicate with the service.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="clientClass" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The name of the client class that CXF generated using CXF's wsdl2java tool. You must use wsdl2java if you do not have both the client and the server in the same JVM. Otherwise, this can be optional if the endpoint address is the same in both cases.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="operation" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    The operation you want to invoke on the outbound endpoint.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="payloadToArguments" default="nullPayloadAsParameter">
            <xsd:annotation>
                <xsd:documentation>
                    This indicates how to treat the payload during the building of the parameters for the cxf call. 
                    It has 2 possible values: "nullPayloadAsParameter" and "nullPayloadAsVoid". They only behave differently if
                    the payload is of type NullPayload. This could change in the future if we add more possible values here.
                    "nullPayloadAsParameter" is the default and indicates that if the payload is a NullPayload, it will be sent in the service call as a parameter.
                    "nullPayloadAsVoid" indicates that if the payload is a NullPayload, then the call will be done as if no parameters were supplied.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:simpleType>
                <xsd:restriction base="xsd:NMTOKEN">
                    <xsd:enumeration value="nullPayloadAsParameter" />
                    <xsd:enumeration value="nullPayloadAsVoid" />
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:attributeGroup>

    <xsd:complexType name="databindingType">
        <xsd:sequence>
            <xsd:any minOccurs="0" maxOccurs="1" namespace="##any" processContents="lax"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="schemasType">
        <xsd:sequence>
            <xsd:element name="schemaLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                        The location of any additional schema to be included inside the WSDL.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="features">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:any minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="interceptors">
        <xsd:sequence>
            <xsd:any minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="propertiesType">
        <xsd:sequence>
            <xsd:element ref="beans:entry" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="wrapper-component" type="wrapperComponentType" substitutionGroup="mule:abstract-component">
        <xsd:annotation>
            <xsd:documentation>
                The WebServiceWrapperComponent class allows you to send the result of a web service call to another endpoint. 
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="wrapperComponentType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractComponentType">
                <xsd:attribute name="address" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            The URL of the web service.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="addressFromMessage" type="mule:substitutableBoolean">
                    <xsd:annotation>
                        <xsd:documentation>
                            Specifies that the URL of the web service will be obtained from the message itself.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="wsdlPort" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            The WSDL port you want to use to communicate to the service.
                         </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="operation" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            The operation you want to invoke on the outbound endpoint.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
    <xsd:element name="stax">
        <xsd:complexType>
            <xsd:complexContent>
                <xsd:extension base="beans:identifiedType">
                    <xsd:attribute name="xmlInputFactory" type="xsd:string" />
                    <xsd:attribute name="xmlOutputFactory" type="xsd:string" />
                </xsd:extension>
            </xsd:complexContent>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="security-manager-callback">
        <xsd:annotation>
            <xsd:documentation>
                A WSS4J Password callback which verifies username/password combinations
                against the Mule security manager.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:complexContent>
                <xsd:extension base="beans:identifiedType">
                    <xsd:attribute name="securityManager-ref">
                        <xsd:annotation>
                            <xsd:documentation>
                                The security manager instance to use for the password callback. (Optional)
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:extension>
            </xsd:complexContent>
        </xsd:complexType>
    </xsd:element>
    
</xsd:schema>

