Hi Lev,

Lev Lvovsky <[EMAIL PROTECTED]> writes:

> ---
> <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-
> ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema "
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:SOAP-
> ENC="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body>...
> ---
>
> I grabbed the Schema file for the envelope here from
> http://schemas.xmlsoap.org/soap/encoding/ (BTW, how can I tell Xerces to
>  get '/' if there is no actual server  file name associated with a URL?),
> named it 'soap-envelope.xsd', and  setExternalSchemaLocation() to be
> 'http://schemas.xmlsoap.org/soap/envelope/ soap-envelope.xsd'.
>
> Upon parsing the response, I get a validation error:
>
> Attribute '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle'
> is not declared for element 'Envelope'.

Let's look at the Envelope type in soap-envelope.xsd:

  <xs:complexType name="Envelope" >
    <xs:sequence>
      <xs:element ref="tns:Header" minOccurs="0" />
      <xs:element ref="tns:Body" minOccurs="1" />
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" 
processContents="lax" />
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>

As you can see, this type allows any attributes as long as they are
from a namespace other than the target namespace. encodingStyle is
from the target namespace.

This schema file appears to be a modified version of the one published
by W3C at:

http://www.w3.org/2001/06/soap-envelope

It seems that the changes that were made (e.g., make encodingStyle
global) broke things.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

Reply via email to