Re: mistake in SOAP envelope XMLSchema

Christopher B Ferris <[email protected]> Wed, 14 Nov 2007 09:07:18 -0500
Newsgroups gmane.text.xml.distributed
Message-ID <OF6CC4847A.7779992D-ON85257393.004C9AB3-85257393.004D6E21@us.ibm.com>
This is a multipart message in MIME format.
--=_alternative 004D6BCA85257393_=
Content-Type: text/plain; charset="US-ASCII"

Alessandro,

The quoted text you cite is pretty clear. I have emphasized using CAPS. 

"SOAP 1.2 DOES NOT ALLOW the env:encodingStyle attribute to appear on the 
SOAP env:Envelope, whereas SOAP 1.1 allows it to appear on any element. 
SOAP 1.2 specifies specific elements where this attribute may be used."

Additionally, from the SOAP1.2 specification [1]:

"The encodingStyle attribute information item MAY appear on the following:
1.      A SOAP header block (see 5.2.1 SOAP header block).
2.      A child element information item of the SOAP Body element 
information item (see 5.3.1 SOAP Body child Element) if that child is not 
a SOAP Fault element information item (see 5.4 SOAP Fault).
3.      A child element information item of the SOAP Detail element 
information item (see 5.4.5.1 SOAP detail entry).
4.      Any descendent of 1, 2, and 3 above.
The encodingStyle attribute information item MUST NOT appear on any 
element other than above in a SOAP message infoset."

The soap:encodingStyle attribute is NOT permitted to be included in on the 
soap:Envelope element. Therefore, the schema is correct.

[1] http://www.w3.org/TR/soap12-part1/#soapencattr

Cheers,

Christopher Ferris
STSM, Software Group Standards Strategy
email: [email protected]
blog: http://www.ibm.com/developerworks/blogs/page/chrisferris
phone: +1 508 234 2986

[email protected] wrote on 11/12/2007 05:44:25 AM:

> Hi all,
> 
> I am writing to this mailing list since I think I found a mistake in
> the official xml schema for SOAP envelopes:
> 
> http://schemas.xmlsoap.org/soap/envelope/
> 
> The error involves the encodingStyle attribute which (as stated in 
> examples in the note and also in [1]) seems possible to use in the 
> Envelope element.
> But the official XMLSchema (http://schemas.xmlsoap.org/soap/envelope/
> ) forbids this since it states:
> 
> [...]
> <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>
> [...]
> 
> I think it should say namespace="##any" in the xs:anyAttribute 
> element (or explicitly define the encodingStyle attribute).
> 
> I wrote you because the company I work for publishes some 
> webservices for our customers, and we use 3rd party libraries for 
> managing SOAP communication. Now some of our customers for some 
> reason are accusing us to be not compliant to the official SOAP 
> protocol, which I think is not true, but even W3C XMLSchema 
> validator shows that the Envelope we use is not valid because of the
> "encodingStyle" attribute.
> 
> Can you please check if it's possible to correct the XMLSchema?
> 
> Thank you in advance for your time,
> 
> Alessandro Pira
> 
> 
> [1] : the SOAP 1.2 part 0 Primer in Chapter 6 (Changes Between SOAP 
> 1.1 and SOAP 1.2) states:
> 
> "SOAP 1.2 does not allow the env:encodingStyle attribute to appear 
> on the SOAP env:Envelope, whereas SOAP 1.1 allows it to appear on 
> any element. SOAP 1.2 specifies specific elements where this 
> attribute may be used."
> 
> 
--=_alternative 004D6BCA85257393_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Alessandro,</font>
<br>
<br><font size=2 face="sans-serif">The quoted text you cite is pretty clear.
I have emphasized using CAPS. </font>
<br>
<br><font size=2 face="Verdana">&quot;SOAP 1.2 DOES NOT ALLOW the env:encodingStyle
attribute to appear on the SOAP env:Envelope, whereas SOAP 1.1 allows it
to appear on any element. SOAP 1.2 specifies specific elements where this
attribute may be used.&quot;</font>
<br>
<br><font size=2 face="Verdana">Additionally, from the SOAP1.2 specification
[1]:</font>
<br>
<br><font size=3>&quot;The </font><tt><font size=3>encodingStyle</font></tt><font size=3>
<i>attribute information item</i> MAY appear on the following:</font>
<br><font size=2 face="sans-serif">1. &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=3>A
SOAP header block (see </font><a href="http://www.w3.org/TR/soap12-part1/#soapheadblock"><font size=3 color=blue><b><u>5.2.1
SOAP header block</u></b></font></a><font size=3>).</font>
<br><font size=2 face="sans-serif">2. &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=3>A
child <i>element information item</i> of the SOAP </font><tt><font size=3>Body</font></tt><font size=3>
<i>element information item</i> (see </font><a href="http://www.w3.org/TR/soap12-part1/#soapbodyel"><font size=3 color=blue><b><u>5.3.1
SOAP Body child Element</u></b></font></a><font size=3>) if that child is
not a SOAP Fault <i>element information item</i> (see </font><a href="http://www.w3.org/TR/soap12-part1/#soapfault"><font size=3 color=blue><b><u>5.4
SOAP Fault</u></b></font></a><font size=3>).</font>
<br><font size=2 face="sans-serif">3. &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=3>A
child <i>element information item</i> of the SOAP </font><tt><font size=3>Detail</font></tt><font size=3>
<i>element information item</i> (see </font><a href="http://www.w3.org/TR/soap12-part1/#faultdetailentry"><font size=3 color=blue><b><u>5.4.5.1
SOAP detail entry</u></b></font></a><font size=3>).</font>
<br><font size=2 face="sans-serif">4. &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=3>Any
descendent of 1, 2, and 3 above.</font>
<p><font size=3>The </font><tt><font size=3>encodingStyle</font></tt><font size=3>
<i>attribute information item</i> MUST NOT appear on any element other
than above in a SOAP message infoset.</font><font size=2 face="Verdana">&quot;</font>
<br>
<br><font size=2 face="sans-serif">The soap:encodingStyle attribute is
NOT permitted to be included in on the soap:Envelope element. Therefore,
the schema is correct.</font>
<br>
<br><font size=2 face="sans-serif">[1] http://www.w3.org/TR/soap12-part1/#soapencattr</font>
<br>
<br><font size=2 face="sans-serif">Cheers,</font>
<br>
<br><font size=2 face="sans-serif">Christopher Ferris<br>
STSM, Software Group Standards Strategy<br>
email: [email protected]<br>
blog: http://www.ibm.com/developerworks/blogs/page/chrisferris<br>
phone: +1 508 234 2986</font>
<br>
<br><tt><font size=2>[email protected] wrote on 11/12/2007 05:44:25
AM:<br>
<br>
&gt; Hi all,</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; I am writing to this mailing list since I think
I found a mistake in<br>
&gt; the official xml schema for SOAP envelopes:</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; http://schemas.xmlsoap.org/soap/envelope/</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; The error involves the encodingStyle attribute
which (as stated in <br>
&gt; examples in the note and also in [1]) seems possible to use in the
<br>
&gt; Envelope element.</font></tt>
<br><tt><font size=2>&gt; But the official XMLSchema (http://schemas.xmlsoap.org/soap/envelope/<br>
&gt; ) forbids this since it states:</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; [...]</font></tt>
<br><tt><font size=2>&gt; &lt;xs:complexType name=&quot;Envelope&quot;&gt;<br>
&gt; &nbsp;&lt;xs:sequence&gt;<br>
&gt; &nbsp; &nbsp;&lt;xs:element ref=&quot;tns:Header&quot; minOccurs=&quot;0&quot;/&gt;<br>
&gt; &nbsp; &nbsp;&lt;xs:element ref=&quot;tns:Body&quot; minOccurs=&quot;1&quot;/&gt;<br>
&gt; &nbsp; &nbsp;&lt;xs:any namespace=&quot;##other&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot; <br>
&gt; processContents=&quot;lax&quot;/&gt;<br>
&gt; &nbsp;&lt;/xs:sequence&gt;<br>
&gt; &nbsp;&lt;xs:anyAttribute namespace=&quot;##other&quot; processContents=&quot;lax&quot;/&gt;<br>
&gt; &lt;/xs:complexType&gt;</font></tt>
<br><tt><font size=2>&gt; [...]</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; I think it should say namespace=&quot;##any&quot;
in the xs:anyAttribute <br>
&gt; element (or explicitly define the encodingStyle attribute).</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; I wrote you because the company I work for publishes
some <br>
&gt; webservices for our customers, and we use 3rd party libraries for
<br>
&gt; managing SOAP communication. Now some of our customers for some <br>
&gt; reason are accusing us to be not compliant to the official SOAP <br>
&gt; protocol, which I think is not true, but even W3C XMLSchema <br>
&gt; validator shows that the Envelope we use is not valid because of the<br>
&gt; &quot;encodingStyle&quot; attribute.</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; Can you please check if it's possible to correct
the XMLSchema?</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; Thank you in advance for your time,</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; Alessandro Pira</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; [1] : the SOAP 1.2 part 0 Primer in Chapter 6
(Changes Between SOAP <br>
&gt; 1.1 and SOAP 1.2) states:</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; &quot;SOAP 1.2 does not allow the env:encodingStyle
attribute to appear <br>
&gt; on the SOAP env:Envelope, whereas SOAP 1.1 allows it to appear on
<br>
&gt; any element. SOAP 1.2 specifies specific elements where this <br>
&gt; attribute may be used.&quot;</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
--=_alternative 004D6BCA85257393_=--