W3C home > Mailing lists > Public > www-ws-desc@w3.org > September 2002

Why <part element=...> Should be Dropped

From: Arthur Ryman <ryman@ca.ibm.com>
Date: Tue, 17 Sep 2002 17:29:39 -0400
Message-ID: <3D879EC3.38411C88@ca.ibm.com>
To: www-ws-desc@w3.org

This issue came up at the f2f.

The WSDL 1.1 <part> element has both a type and an element attribute.
The values of these attributes are an XML schema type or element
respectively. This note explains why the element attribute should be

The type and element attributes are mutually exclusive. These attributes
interact with the SOAP, HTTP  and MIME bindings in a complex way.
However, the purpose of the <part> element is to describe message parts
in a way that is independent of bindings. The binding specifications
should describe how the message is formatted for a particular
combination of transport, protocol, etc. It is therefore desirable to
eliminate any binding information bias from the message description.

The normal programming language concept of a data type is captured by
the XML Schema notion of type. An XML Schema type can be either simple
(e.g. a string or a number) or complex, e.g. contain XML elements.
Clearly an XML Schema type is more general than an element. In addition,
it is natural to view an element as the content model for a complex type
that contains it. For example, the type of a WSDL document can be viewed
as the following complex type:

  <complexType name="WSDLDefinitionsType">
      <element ref="wsdl:definitions"/>

Therefore, any <part> that uses the element attribute can be replaced by
an equivalent <part> the uses the type attribute where the type names
the complexType that wraps the element.

In fact the WSDL 1.1 spec section 2.3.1 describes how to wrap elements
in a complex type in the case where different responses from an
operation return different elements (e.g. a purchase order or a set of
invoices). Since the WSDL author is forced to use the type attribute in
this case, it seems very unwise to define bindings that place
significance on the choice of element versus type. For example, the SOAP
binding treats the type attribute as abstract and the element attribute
as concrete. For simplicity, all message parts should be viewed as
abstract in the sense that their format is only determined once a
binding is given. (Of course, the binding may say that the format is XML
and that it exactly matches the XML schema type identified by the
message part).

WSDL authors therefore lose no generality by defining message parts
using the type attribute only. The only drawback is that the author may
have to explicitly define a wrapper complex type for an existing
element. The element attribute can therefore be viewed as syntactic
sugar, but the complexity it adds to the bindings nullifies this

Dropping the element attribute also requires that the SOAP, HTTP and
MIME bindings be updated to reflect this change.

-- Arthur Ryman
Received on Tuesday, 17 September 2002 17:30:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:06:25 UTC