<?xml version="1.0" encoding="UTF-8"?>

<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
-->

<xs:schema targetNamespace="http://cxf.apache.org/bindings/corba" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:corba="http://cxf.apache.org/bindings/corba" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    jaxb:version="2.0"
    elementFormDefault="qualified" 
    attributeFormDefault="unqualified"> 
    
    <xs:import namespace="http://schemas.xmlsoap.org/wsdl/"
        schemaLocation="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd"/>
  
        <xs:complexType name="corbaType">
                <xs:annotation>
                        <xs:documentation>Anonymous IDL type. Has no repository ID.
            Used for intermediate types for multidimensional arrays and sequences of sequences.
            </xs:documentation>            
        <xs:appinfo>
            <jaxb:class implClass="org.apache.cxf.binding.corba.wsdl.CorbaTypeImpl"/>                                
        </xs:appinfo>      
                </xs:annotation>
                <xs:attribute name="name" type="xs:string" use="required">
                  <xs:annotation>
                    <xs:documentation>Specifies a name for the mapped type. Typically this name is derived from the XML Schema type being mapped.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="type" type="xs:QName" use="required">
                  <xs:annotation>
                    <xs:documentation>Specifies the XML Schema type being mapped to the CORBA type.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="qualified" type="xs:boolean" />
        </xs:complexType>
        <xs:complexType name="namedType">
                <xs:annotation>
                        <xs:documentation>An IDL type with a repository ID.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="repositoryID" type="xs:string" use="required">
                                  <xs:annotation>
                                    <xs:documentation>Specifies the fully qualified repository ID of the CORBA type being mapped.</xs:documentation>
                                  </xs:annotation>
                                </xs:attribute>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:simpleType name="long">
                <xs:restriction base="xs:int"/>
        </xs:simpleType>
        <xs:simpleType name="ulong">
                <xs:restriction base="xs:unsignedInt"/>
        </xs:simpleType>
        <xs:simpleType name="longlong">
                <xs:restriction base="xs:long"/>
        </xs:simpleType>
        <xs:simpleType name="ulonglong">
                <xs:restriction base="xs:unsignedLong"/>
        </xs:simpleType>
        <xs:simpleType name="short">
                <xs:restriction base="xs:short"/>
        </xs:simpleType>
        <xs:simpleType name="ushort">
                <xs:restriction base="xs:unsignedShort"/>
        </xs:simpleType>
        <xs:simpleType name="float">
                <xs:restriction base="xs:float"/>
        </xs:simpleType>
        <xs:simpleType name="double">
                <xs:restriction base="xs:double"/>
        </xs:simpleType>
        <!-- this mapping needs to be changes once the xml schema long double mapping is introduced -->
        <xs:simpleType name="longdouble">
                <xs:restriction base="xs:double"/>
        </xs:simpleType>
        <xs:simpleType name="char">
                <xs:restriction base="xs:byte"/>
        </xs:simpleType>
        <xs:simpleType name="wchar">
                <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:simpleType name="boolean">
                <xs:restriction base="xs:boolean"/>
        </xs:simpleType>
        <xs:simpleType name="octet">
                <xs:restriction base="xs:unsignedByte"/>
        </xs:simpleType>
        <xs:simpleType name="string">
                <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:simpleType name="wstring">
                <xs:restriction base="xs:string"/>
        </xs:simpleType>

    <!--
    corba:dateTime definition based on TimeBase.
    #include <omg/TimeBase.idl>
    TimeBase::UtcT;
    -->
    <xs:simpleType name="dateTime">
        <xs:restriction base="xs:dateTime"/>
    </xs:simpleType>

        <xs:complexType name="any">
                <xs:complexContent>
                        <xs:extension base="xs:anyType"/>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="memberType">
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="idltype" type="xs:QName" use="required"/>
                <xs:attribute name="qualified" type="xs:boolean" />
                <xs:attribute name="anonschematype" type="xs:boolean" />
        </xs:complexType>
        <xs:complexType name="object">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:attribute name="binding" type="xs:QName" use="optional"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="struct">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:sequence>
                                        <xs:element name="member" type="corba:memberType" minOccurs="0" maxOccurs="unbounded"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="exception">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:sequence>
                                        <xs:element name="member" type="corba:memberType" minOccurs="0" maxOccurs="unbounded"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="caseType">
                <xs:attribute name="label" type="xs:string" use="required"/>
        </xs:complexType>
        <xs:complexType name="unionbranch">
                <xs:sequence>
                        <xs:element name="case" type="corba:caseType" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="idltype" type="xs:QName" use="required"/>
                <xs:attribute name="default" type="xs:boolean" use="optional"/>
                <xs:attribute name="qualified" type="xs:boolean" />
        </xs:complexType>
        <xs:complexType name="union">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:sequence>
                                        <xs:element name="unionbranch" type="corba:unionbranch" maxOccurs="unbounded"/>
                                </xs:sequence>
                                <xs:attribute name="discriminator" type="xs:QName" use="required"/>
                                <xs:attribute name="nillable" type="xs:boolean" />
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="alias">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:attribute name="basetype" type="xs:QName"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="anonsequence">
                <xs:annotation>
                        <xs:documentation>Anonymous sequence type.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="elemtype" type="xs:QName" use="required"/>
                                <xs:attribute name="bound" type="corba:ulong" use="required"/>
                                <xs:attribute name="elemname" type="xs:QName" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="sequence">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:attribute name="elemtype" type="xs:QName" use="required"/>
                                <xs:attribute name="bound" type="corba:ulong" use="required"/>
                                <xs:attribute name="elemname" type="xs:QName" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="anonarray">
                <xs:annotation>
                        <xs:documentation>Anonymous array type.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="elemtype" type="xs:QName" use="required"/>
                                <xs:attribute name="bound" type="corba:ulong" use="required"/>
                                <xs:attribute name="elemname" type="xs:QName" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="array">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:attribute name="elemtype" type="xs:QName" use="required"/>
                                <xs:attribute name="bound" type="corba:ulong" use="required"/>
                                <xs:attribute name="elemname" type="xs:QName" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="enumerator">
                <xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
        </xs:complexType>
        <xs:complexType name="enum">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:sequence>
                                        <xs:element name="enumerator" type="corba:enumerator" maxOccurs="unbounded"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="anonstring">
                <xs:annotation>
                        <xs:documentation>Anonymous type for bounded strings.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="bound" type="corba:ulong"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="anonwstring">
                <xs:annotation>
                        <xs:documentation>Anonymous type for bounded wstrings.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="bound" type="corba:ulong"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="fixed">
                <xs:complexContent>
                        <xs:extension base="corba:namedType">
                                <xs:attribute name="digits" type="corba:ulong"/>
                                <xs:attribute name="scale" type="corba:ulong"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="anonfixed">
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="digits" type="corba:ulong"/>
                                <xs:attribute name="scale" type="corba:ulong"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="const">
                <xs:complexContent>
                        <xs:extension base="corba:corbaType">
                                <xs:attribute name="value" type="xs:string" use="required"/>
                                <xs:attribute name="idltype" type="xs:QName" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="typeMapping" type="corba:typeMappingType"/>
        <xs:complexType name="typeMappingType">
                <xs:annotation>
                        <xs:documentation>CXF CORBA WSDL binding type map.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="wsdl:tExtensibilityElement">
                                <xs:sequence>
                                        <xs:choice maxOccurs="unbounded">
                                                <xs:element name="struct" type="corba:struct"/>
                                                <xs:element name="exception" type="corba:exception"/>
                                                <xs:element name="union" type="corba:union"/>
                                                <xs:element name="alias" type="corba:alias"/>
                                                <xs:element name="sequence" type="corba:sequence"/>
                                                <xs:element name="array" type="corba:array"/>
                                                <xs:element name="enum" type="corba:enum"/>
                                                <xs:element name="fixed" type="corba:fixed"/>
                                                <xs:element name="anonsequence" type="corba:anonsequence"/>
                                                <xs:element name="anonarray" type="corba:anonarray"/>
                                                <xs:element name="anonstring" type="corba:anonstring"/>
                                                <xs:element name="anonwstring" type="corba:anonwstring"/>
                                                <xs:element name="anonfixed" type="corba:anonfixed"/>
                                                <xs:element name="const" type="corba:const"/>
                                                <xs:element name="object" type="corba:object"/>
                                        </xs:choice>
                                </xs:sequence>
                                <xs:attribute name="targetNamespace" type="xs:anyURI" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <!-- Begin CORBA Binding Definitions -->
        <xs:complexType name="addressType">
                <xs:annotation>
                        <xs:documentation>CXF CORBA Address Type</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="wsdl:tExtensibilityElement">
                                <xs:attribute name="location" type="xs:string" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="address" type="corba:addressType"/>
        <xs:complexType name="policyType">
                <xs:annotation>
                        <xs:documentation>
                Artix IIOP tunnel policy specification.
            </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="wsdl:tExtensibilityElement">
                                <xs:attribute name="poaname" type="xs:string" use="optional">
                                        <xs:annotation>
                                                <xs:documentation>
                                                        Attribute used to set a poaname, otherwise it will
                                                        default to the service name that this port runs under.

                                                        poaname is used for setting certain policies, such
                                                        as direct persistence and well-known port numbers in
                                                        the orb config file.
                                                </xs:documentation>
                                        </xs:annotation>
                                </xs:attribute>
                                <xs:attribute name="serviceid" type="xs:string" use="optional">
                                        <xs:annotation>
                                                <xs:documentation>
                                                        Attribute used to set a serviceid
                                                        see CORBA documentation for more details.
                                                </xs:documentation>
                                        </xs:annotation>
                                </xs:attribute>
                                <xs:attribute name="persistent" type="xs:boolean" use="optional" default="false">
                                        <xs:annotation>
                                                <xs:documentation>
                                                        Attribute select whether to use a persistent poa.
                                                        see CORBA documentation for more details.
                                                </xs:documentation>
                                        </xs:annotation>
                                </xs:attribute>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="policy" type="corba:policyType"/>

    <xs:simpleType name="basesType">
        <xs:list itemType="xs:string"/>
    </xs:simpleType>
    <xs:complexType name="bindingType">
                <xs:annotation>
                        <xs:documentation>CXF CORBA Binding Type</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="wsdl:tExtensibilityElement">
                                <xs:attribute name="repositoryID" type="xs:string" use="required"/>
                <xs:attribute name="bases" type="corba:basesType" use="optional"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="binding" type="corba:bindingType">
                <xs:annotation>
                        <xs:documentation>CXF CORBA Binding Element</xs:documentation>
                </xs:annotation>
        </xs:element>
        <xs:complexType name="operationType">
                <xs:annotation>
                        <xs:documentation>CORBA Operation Type</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="wsdl:tExtensibilityElement">
                                <xs:sequence>
                                        <xs:element name="param" type="corba:paramType" minOccurs="0" maxOccurs="unbounded"/>
                                        <xs:element name="return" type="corba:argType" minOccurs="0"/>
                                        <xs:element name="raises" type="corba:raisesType" minOccurs="0" maxOccurs="unbounded"/>
                                </xs:sequence>
                                <xs:attribute name="name" type="xs:string" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="operation" type="corba:operationType">
                <xs:annotation>
                        <xs:documentation>CORBA Operation</xs:documentation>
                </xs:annotation>
        </xs:element>
        <xs:complexType name="argType">
                <xs:annotation>
                        <xs:documentation>CORBA Param Type</xs:documentation>
                </xs:annotation>
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="idltype" type="xs:QName" use="required"/>
        </xs:complexType>
        <xs:complexType name="paramType">
                <xs:annotation>
                        <xs:documentation>CORBA Param Type</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="corba:argType">
                                <xs:attribute name="mode" type="corba:modeType" use="required"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:simpleType name="modeType">
                <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="in"/>
                        <xs:enumeration value="inout"/>
                        <xs:enumeration value="out"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:complexType name="raisesType">
                <xs:annotation>
                        <xs:documentation>CORBA Raises Declaration</xs:documentation>
                </xs:annotation>
                <xs:attribute name="exception" type="xs:QName" use="required"/>
        </xs:complexType>
        <!-- End CORBA Binding Definitions -->
</xs:schema>
