<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.mulesource.org/schema/mule/axis/2.0"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
    targetNamespace="http://www.mulesource.org/schema/mule/axis/2.0" 
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0" 
                schemaLocation="http://www.mulesource.org/schema/mule/core/2.0/mule.xsd" />

    <xsd:element name="connector" type="axisConnectorType" substitutionGroup="mule:abstract-connector">
        <xsd:annotation>
            <xsd:documentation>
                Consume and provide web services via axis.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:complexType name="axisConnectorType">
        <xsd:complexContent>        
            <xsd:extension base="mule:connectorType">
                <xsd:sequence>
                    <xsd:element ref="bean-type" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="supported-scheme" type="mule:valueType" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
                <xsd:attribute name="axis-ref" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Bean reference to the axis server that should be used.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="clientConfig" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Configuration file to use when building the axis client.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="clientProvider-ref" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Bean reference to the client provider that should be used to
                            create the axis client.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="doAutoTypes" type="mule:substitutableBoolean">
                    <xsd:annotation>
                        <xsd:documentation>
                            Use this property to configure whether AxisServer should automatically map types.
                            This property has only effect if you don't provide your own axisServer via the
                            'axisServer-ref' property.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="serverConfig" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Configuration file to use when building the axis server.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="serverProvider-ref" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Bean reference to the server provider that should be used to create the
                            AxisServer.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="treatMapAsNamedParams" type="mule:substitutableBoolean">
                    <xsd:annotation>
                        <xsd:documentation>
                            The AxisConnector treats a Map as container for named parameters, which 
                            eventually will be unpacked. This will result into a problem if your exposed 
                            service needs to take a Map as a parameter, because the actual Map will never 
                            reach the service intact. In this case set this property to false.
                        </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:abstractInboundEndpointType">
                <xsd:sequence>
                    <xsd:group ref="inboundPropertyElements"/>
                    <xsd:group ref="generalPropertyElements"/>
                    <xsd:group ref="mule:defaultEndpointElements"/>
                </xsd:sequence>
                <xsd:attributeGroup ref="inboundPropertyAttributes"/>
                <xsd:attributeGroup ref="generalPropertyAttributes"/>
                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
            </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:abstractOutboundEndpointType">
                <xsd:sequence>
                    <xsd:group ref="generalPropertyElements"/>
                    <xsd:group ref="mule:defaultEndpointElements"/>
                </xsd:sequence>
                <xsd:attributeGroup ref="generalPropertyAttributes"/>
                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
            </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:abstractGlobalEndpointType">
                <xsd:sequence>
                    <xsd:group ref="inboundPropertyElements"/>
                    <xsd:group ref="generalPropertyElements"/>
                    <xsd:group ref="mule:defaultEndpointElements"/>
                </xsd:sequence>
                <xsd:attributeGroup ref="inboundPropertyAttributes"/>
                <xsd:attributeGroup ref="generalPropertyAttributes"/>
                <xsd:attributeGroup ref="mule:defaultEndpointAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:attributeGroup name="inboundPropertyAttributes">
        <xsd:attribute name="wsdlFile" type="xsd:string"/>
    </xsd:attributeGroup>

    <xsd:attributeGroup name="generalPropertyAttributes">
        <xsd:attribute name="clientConfig" type="xsd:string"/>
        <xsd:attribute name="soapAction" type="xsd:string"/>
        <xsd:attribute name="SOAPAction" type="xsd:string"/>
        <xsd:attribute name="serviceNamespace" type="xsd:string"/>
        <xsd:attribute name="style">
            <xsd:simpleType>
                <xsd:restriction base="xsd:NMTOKEN">
                    <!-- see org.apache.axis.constants.Style -->
                    <xsd:enumeration value="RPC"/>
                    <xsd:enumeration value="DOCUMENT"/>
                    <xsd:enumeration value="MESSAGE"/>
                    <xsd:enumeration value="WRAPPED"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="use">
            <xsd:simpleType>
                <xsd:restriction base="xsd:NMTOKEN">
                    <xsd:enumeration value="ENCODED"/>
                    <xsd:enumeration value="LITERAL"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:attributeGroup>

    <xsd:group name="inboundPropertyElements">
        <xsd:sequence>
            <xsd:element name="options" minOccurs="0">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="option" type="mule:keyValueType" minOccurs="0" maxOccurs="unbounded"/>
                    </xsd:sequence>
                    <xsd:attribute name="allowedMethods" type="xsd:string"/>
                    <xsd:attribute name="scope" type="xsd:string"/>
                    <xsd:attribute name="wsdlPortType" type="xsd:string"/>
                    <xsd:attribute name="wsdlServicePort" type="xsd:string"/>
                    <xsd:attribute name="wsdlServiceElement" type="xsd:string"/>
                    <xsd:attribute name="wsdlTargetNamespace" type="xsd:string"/>
                    <xsd:attribute name="wsdlInputSchema" type="xsd:string"/>
                    <xsd:attribute name="wsdlSoapActionMode" type="xsd:string"/>
                    <xsd:attribute name="extraClasses" type="xsd:string"/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element ref="bean-type" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:group>

    <xsd:group name="generalPropertyElements">
        <xsd:sequence>
            <xsd:element name="soap-service" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:attribute name="interface" type="xsd:string"/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="soap-method" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="soap-parameter" minOccurs="0" maxOccurs="unbounded">
                            <xsd:complexType>
                                <xsd:attribute name="parameter" type="xsd:string" use="required"/>
                                <xsd:attribute name="type" type="xsd:string" use="required"/>
                                <xsd:attribute name="mode">
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:NMTOKEN">
                                            <xsd:enumeration value="IN"/>
                                            <xsd:enumeration value="OUT"/>
                                            <xsd:enumeration value="INOUT"/>
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:attribute>
                            </xsd:complexType>
                        </xsd:element>
                        <xsd:element name="soap-return" minOccurs="0">
                            <xsd:complexType>
                                <xsd:attribute name="type" type="xsd:string" use="required"/>
                            </xsd:complexType>
                        </xsd:element>
                    </xsd:sequence>
                    <xsd:attribute name="method" type="xsd:string" use="required"/>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:element name="bean-type">
        <xsd:complexType>
            <xsd:attribute name="interface" type="xsd:string"/>
        </xsd:complexType>
    </xsd:element>

</xsd:schema>
