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