W3C home > Mailing lists > Public > www-ws-desc@w3.org > July 2005

WSDL 2.0 element order enforcement in schema

From: Lawrence Mandel <lmandel@ca.ibm.com>
Date: Tue, 5 Jul 2005 12:09:32 -0400
To: www-ws-desc@w3.org
Message-ID: <OFD0AB379E.8CF698B6-ON85257035.0055FE0C-85257035.0058C4E6@ca.ibm.com>
While looking at the WSDL 2.0 schema today I came across a question about 
the ordering of elements in a WSDL 2.0 document. 

Section 2.1.2 of the WSDL 2.0 spec defines the following XML 
representation of WSDL 2.0,

<description
      targetNamespace="xs:anyURI" >
  <documentation />*
  [ <import /> | <include /> ]*
  <types />?
  [ <interface /> | <binding /> | <service /> ]*
</description>

This definition imposes ordering constraints on the elements in the WSDL 
2.0 document. The WSDL 2.0 schema does not currently enforce this 
ordering. The description type is defined as follows,

<xs:complexType name='DescriptionType' >
    <xs:annotation>
      <xs:documentation>

        Please refer to the WSDL 2.0 specification for
                 additional constraints on the contents of this type.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base='wsdl:ExtensibleDocumentedType' >
        <xs:choice minOccurs='0' maxOccurs='unbounded' >
          <xs:element ref='wsdl:import' />
          <xs:element ref='wsdl:include' />
          <xs:element ref='wsdl:types'/>

          <xs:element ref='wsdl:interface' />
                       <xs:element ref='wsdl:binding' />
                       <xs:element ref='wsdl:service' />
          <xs:any namespace='##other' processContents='lax' />
        </xs:choice>
                 <xs:attribute name='targetNamespace' type='xs:anyURI' 
use='required' />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

The schema can be updated as follows to enforce the ordering outlined in 
the spec.

<xs:complexType name='DescriptionType' >
    <xs:annotation>
      <xs:documentation>
        Please refer to the WSDL 2.0 specification for
        additional constraints on the contents of this type.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base='wsdl:ExtensibleDocumentedType' >
        <xs:sequence>
          <xs:choice minOccurs='0' maxOccurs='unbounded' >
            <xs:element ref='wsdl:import' />
            <xs:element ref='wsdl:include' />
          </xs:choice>
          <xs:element ref='wsdl:types' minOccurs="0" maxOccurs="1"/>
          <xs:choice minOccurs='0' maxOccurs='unbounded' >
            <xs:element ref='wsdl:interface' />
            <xs:element ref='wsdl:binding' />
            <xs:element ref='wsdl:service' />
            <xs:any namespace='##other' processContents='lax' />
          </xs:choice>
        </xs:sequence>
        <xs:attribute name='targetNamespace' type='xs:anyURI' use=
'required' />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

Is the omission of ordering constraints from the schema intentional? Can 
someone update the schema to enforce section 2.1.2 of the spec?


Thanks,

Lawrence Mandel

Software Developer
IBM Rational Software
Phone: 905 - 413 - 3814   Fax: 905 - 413 - 4920
lmandel@ca.ibm.com
Received on Tuesday, 5 July 2005 16:09:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:36 GMT