Page 1 of 1

Validation of a SOAP-Message does not work

Posted: Tue Sep 13, 2011 5:33 pm
by tkoch
My xml's should validate against xsd's with a structure like:

Code: Select all

master.xsd
|- slave1.xsd
|-- slave2.xsd
There is no problem if I validate the pure xml.

Code: Select all


<myDS xmlns="master.xsd">
...
<mySS xmlns="slave1.xsd">
...
</mySS>
...
</myDS>
Now if this xml is sent in a SOAP-Message and I want to validate this SOAP-Message, it fails.

Code: Select all


<s:Envelope ...>
<s:Header>...</s:Header>
<s:Body ...>
<myDS xmlns="master.xsd">
...
<mySS xmlns="slave1.xsd">
...
</mySS>
...
</myDS>
</s:Body>
</s:Envelope>
Actually I think it should work with the schemas.xmlsoap.org-soap.xsd only.

I found a hack enlarging the schemas.xmlsoap.org-soap.xsd by <import ...> tags. This works so far.
But in my opinion this should not be necessary.

Is there any solution to avoid my hack?

Re: Validation of a SOAP-Message does not work

Posted: Wed Sep 14, 2011 11:29 am
by Radu
Hi,

I'm sorry but I don't quite understand everything.

What is this construct?

Code: Select all

xmlns="master.xsd"
The xmlns attribute defines a binding for the default namespace of the current element. Are you referring to the xsi:schemaLocation attribute which specifies the schema which should be used to validate the XML file?

Probably the SOAP server also needs to know the XML Schema locations in order to validate the XML on its side. Is this related in any way to WSDL?

Regards,
Radu