Validation with encodingStyle set fails
Fraser Goffin <[email protected]> Sat, 8 Feb 2003 19:08:11 +0000
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <[email protected]> |
Dear All,
I am having a problem validating a SOAP message. Validation of SOAP headers
and the payload are fine EXCEPT when I include 'encodingStyle' attribute on
the immediate child element of the SOAP Body. For example, I load the
schemas I want to use into a schema cache, in this case the schemas are :-
- envelope.xsd (the SOAP Envelope schema - attached)
- the schema for the Authentication header namespace
- the schema for the Payload namespace
Everything validates correctly, and if I deliberately invalidate any part of
the message the validator spots it :-
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns1:Authentication xmlns:ns1="some-uri" soap:mustUnderstand="1">
<ns1:UserID>userid</ns1:UserID>
<ns1:Pwd>password</nugas:Pwd>
</ns1:Authentication>
</soap:Header>
<soap:Body>
<ns2:Payload xmlns:ns2="urn:Payload">
...
</ns2:Payload>
</soap:Body>
</soap:Envelope>
However, as soon as I add the soap:encoding attribute :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns1:Authentication xmlns:ns1="some-uri" soap:mustUnderstand="1">
<ns1:UserID>userid</ns1:UserID>
<ns1:Pwd>password</nugas:Pwd>
</ns1:Authentication>
</soap:Header>
<soap:Body>
<ns2:Payload xmlns:ns2="urn:Payload"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
...
</ns2:Payload>
</soap:Body>
</soap:Envelope>
This validation error occurs :
'The attribute '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle' on
this element is not defined in the DTD/Schema.'
When I step through the process (I am using a SAX parser) the error actually
occurs on the SOAP Body element, that is, not even the element that contains
the encodingStyle attribute ??
Has anyone got a clue why this is and how I can fix it ??
(Note: If I remove the SOAP envelope schema from the schema cache SAX
reports a validation error because there is no schema for the root node of
the document)
Regards
Fraser.
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://messenger.msn.co.uk
You can read messages from the SOAP archive, unsubscribe from SOAP, or subscribe to other
DevelopMentor lists at http://discuss.develop.com.