This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5483 - WSDL schema defines fault 'element' incorrectly
Summary: WSDL schema defines fault 'element' incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WSDL
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.0
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Philippe Le Hegaret
QA Contact: WSDL Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-15 16:46 UTC by John Kaputin
Modified: 2008-03-31 19:14 UTC (History)
0 users

See Also:


Attachments

Description John Kaputin 2008-02-15 16:46:00 UTC
The Part 1 Core spec defines the interface fault 'element' attribute as a union:
"The type of the element attribute information item is a union of xs:QName and xs:token where the allowed token values are #any, #none, or #other.".

The WSDL 2.0 schema at http://www.w3.org/2007/06/wsdl/wsdl20.xsd defines the 'element' attribute as a xs:QName. 
<xs:attribute name="element" type="xs:QName" use="optional"/>
 
The {message content model} property of the Interface Fault component is constrained by assertion InterfaceFault-1013 which says:
 "An xs:token with one of the values #any, #none, #other, or #element.".

It is not possible to test for this assertion error because a schema validation error will be reported if a WSDL 2.0 document has an interface fault with an 'element' attribute that contains one of these token values.

The schema validation error reported by Xerces is:
[Error] little.wsdl:20:58: cvc-datatype-valid.1.2.1: '#any' is not a valid value for 'QName'.

The WSDL testcase is:

<?xml version="1.0" encoding="utf-8" ?>
<description xmlns="http://www.w3.org/ns/wsdl"
	targetNamespace="http://greath.example.com/2004/services/reservationDetails"
	xmlns:tns="http://greath.example.com/2004/services/reservationDetails"
	xmlns:items="http://greath.example.com/2004/schemas/reservationItems"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<types>
		<xs:schema id="items"
		targetNamespace="http://greath.example.com/2004/schemas/reservationItems">
			<xs:element name="confirmationNumber" type="xs:string" />
			<xs:element name="checkInDate" type="xs:date" />
			<xs:element name="checkOutDate" type="xs:date" />
			<xs:element name="roomType" type="xs:string" />
			<xs:element name="smoking" type="xs:boolean" />
		</xs:schema>
	</types>
	
    <interface name="reservationInterface">
        <fault name="invalidDataFault1" element="#any" />
		<operation name="queryBooking" pattern="http://www.w3.org/2004/03/wsdl/in-out">
			<input messageLabel="In" element="items:confirmationNumber" />
			<output messageLabel="Out" element="items:checkInDate" />
			<outfault messageLabel="Out" ref="tns:invalidDataFault1" /> 
		</operation>
    </interface>
	
</description>
Comment 1 Arthur Ryman 2008-02-16 03:42:55 UTC
John, Thx. I'll review this.
Comment 2 Arthur Ryman 2008-03-19 02:50:19 UTC
John, I agree that this is a mistake in the schema. As I recall it, there was a late comment that proposed that the content of Faults should be the same type as Message. The spec was updated but the schema wasn't. There is already a type definition to describe the union:

  <xs:simpleType name="ElementReferenceType">
    <xs:annotation>
      <xs:documentation>
      Use the QName of a GED that describes the content, 
      #any for any content, 
      #none for empty content, or 
      #other for content described by some other extension attribute that references a declaration in a non-XML extension type system.
      </xs:documentation>
    </xs:annotation>
    <xs:union memberTypes="xs:QName">
      <xs:simpleType>
        <xs:restriction base="xs:token">

          <xs:enumeration value="#any"/>
          <xs:enumeration value="#none"/>
          <xs:enumeration value="#other"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

This type is used to define messages:

  <xs:complexType name="MessageRefType" mixed="false">
    <xs:complexContent>
      <xs:extension base="wsdl:ExtensibleDocumentedType">

        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:any namespace="##other" processContents="lax" minOccurs="1" maxOccurs="1"/>
        </xs:choice>
        <xs:attribute name="messageLabel" type="xs:NCName" use="optional"/>
        <xs:attribute name="element" type="wsdl:ElementReferenceType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

The fix is to correct the definition of faults which is currently:

  <xs:complexType name="InterfaceFaultType" mixed="false">
    <xs:complexContent>
      <xs:extension base="wsdl:ExtensibleDocumentedType">
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:any namespace="##other" processContents="lax" minOccurs="1" maxOccurs="1"/>
        </xs:choice>
        <xs:attribute name="name" type="xs:NCName" use="required"/>

        <xs:attribute name="element" type="xs:QName" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

To:

  <xs:complexType name="InterfaceFaultType" mixed="false">
    <xs:complexContent>
      <xs:extension base="wsdl:ExtensibleDocumentedType">
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:any namespace="##other" processContents="lax" minOccurs="1" maxOccurs="1"/>
        </xs:choice>
        <xs:attribute name="name" type="xs:NCName" use="required"/>

        <xs:attribute name="element" type="wsdl:ElementReferenceType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

Comment 3 Philippe Le Hegaret 2008-03-31 19:14:15 UTC
This has been fixed as suggested.