Loading ...
Sorry, an error occurred while loading the content.

Problems with current WSDL MIME schema

Expand Messages
  • Peter Hendry
    I wanted to run this past these groups before putting it to the WS-I AP and WSDL WG lists in case I m missing something. The MIME WSDL 1.1 schema
    Message 1 of 1 , Aug 27, 2006
      I wanted to run this past these groups before putting it to the WS-I AP
      and WSDL WG lists in case I'm missing something.

      The MIME WSDL 1.1 schema (http://schemas.xmlsoap.org/wsdl/mime/) seems
      to be out of touch with reality failing to validate either WS-I AP
      compliant WSDL files or "standard" MIME WSDL files in the wild. There
      appear to be 3 problems

      1) the mime:part elements in mime:multipartRelated used to require
      qualification but now they don't (and must not be qualified).
      2) the mime:part element now *requires* a "name" attribute.
      3) the mime:part element disallows soap:body (only allows
      mime:*) as a child element.

      Each of these breaks existing WSDLs and breaks the examples for the WS-I
      AP. More details below.


      The latest version of the wsdl-mime schema at
      http://schemas.xmlsoap.org/wsdl/mime/ has changes from the original
      schema that cause most MIME WSDL documents to fail to validate. This
      makes it unusable for validation (see
      https://bugs.eclipse.org/bugs/show_bug.cgi?id=145583 to see that doing
      validation involves modifying the schema and using the locally modified
      version for validation).

      There are 3 major problems:

      1) The change to add the "tPart" complexType. In the original schema the
      mime:multipartRelated element was defined as

      <element name="multipartRelated" type="mime:multipartRelatedType"/>
      <complexType name="multipartRelatedType" content="elementOnly">
      <element ref="mime:part" minOccurs="0" maxOccurs="unbounded"/>
      <element name="part" type="mime:partType"/>

      which leads to documents with

      <mime:part .../>

      However, in the current schema the multipartRelated element is defined as

      <element name="multipartRelated" type="mime:multipartRelatedType"/>
      <complexType name="multipartRelatedType">
      <extension base="wsdl:tExtensibilityElement">
      <element name = "part" type = "mime:tPart" minOccurs="0"
      <complexType name="tPart">
      <any namespace="##targetNamespace" minOccurs="0"
      <attribute name="name" type="NMTOKEN" use="required"/>

      On the schema elementFormDefault is not defined so this new version leads to

      <part ...>

      and any document with the original

      <mime:part .../>

      is invalid against the new schema. Since I would imagine this is all mime
      WSDL documents
      (and any that comply with the WS-I attachment profile) this makes the schema

      The simplest fix would be to add elementFormDefault="qualified" to the
      schema as I assume all elements should be qualified.

      2) The new "tPart" type has added a required "name"
      attribute. What is this? To what is it meant to
      refer? Why is it needed? I have not seen MIME
      WSDL with this defined so they do no validate.
      The WS-I examples do not define this and so do
      not validate.

      3) The valid content of a <mime:part> element
      excludes <soap:body>. WS-I and all vendors
      I am aware of define MIME content such as

      <soap:body use="literal"/>

      According to the current wsdl-mime schema's tPart complexType, this is
      invalid as the wildcard content of <mime:part> is
      defined with namespace="##targetNamespace".

      The original mime-wsdl schema had this problem and it has not been addressed
      in the current schema.

      Attached are 3 sample WSDL files each of which fails to validate using the current mime schema.

      - failed to validate because it uses "mime:part"
      instead of just "part". The error from Xerces is

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'mime:part'. One of '{part}' is expected.

      - here "mime:part" has been changed to "part"
      (and xmlns="" added as appropriate to unqualify
      the part elements).

      cvc-complex-type.4: Attribute 'name' must appear on element 'part'.

      - name attributes added to each part. Now the
      error relates to the use of soap:body within
      the part

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'soap:body'. One of '{WC["http://schemas.xmlsoap.org/wsdl/mime/"]}' is expected.

      The WS-I AP shows the (apparently invalid) example


      A WSDL Description that is as follows:

      <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"


      <wsdl:binding name="aBinding" type="tns:aPortType">
      <soapbind:binding style="rpc"
      <wsdl:operation name="anOperation">
      <soap:operation soapAction="http://example.com/soapaction"/>
      <soapbind:body use="literal"
      <soapbind:body use="literal"

      Which is invalid against the schema for all 3 reasons given above.

      I assume, like us, other tool vendors have been using their
      own WSDL validation rather than rely on the schemas which
      is why this has not come up before. If nobody points out
      the flaws in this logic then I'll forward these issues to
      the WS-I AP and WSDL WG mailing lists for comment (and
      hopefully resolution).

    Your message has been successfully submitted and would be delivered to recipients shortly.