Page 1 of 1

Can't validate SOAP 1.2 response

Posted: Thu Oct 12, 2006 5:28 pm
by nashif
Hi,
When I try to validate the following soap response (this envelope I copy/pasted from the SOAP spec):

Code: Select all


<?xml version="1.0" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xml="http://www.w3.org/XML/1998/namespace">
<env:Header>
<env:Upgrade>
<env:SupportedEnvelope qname="ns1:Envelope"
xmlns:ns1="http://www.w3.org/2003/05/soap-envelope"/>
<env:SupportedEnvelope qname="ns2:Envelope"
xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"/>
</env:Upgrade>
</env:Header>
<env:Body>
<env:Fault>
<env:Code><env:Value>env:VersionMismatch</env:Value></env:Code>
<env:Reason>
<env:Text xml:lang="en">Version Mismatch</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>
I get the following errors:

Code: Select all


SystemID: http://www.w3.org/2003/05/soap-envelope/
Location: 97:52
Description: src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component.
URL: http://www.w3.org/TR/xmlschema-1/#src-resolve

SystemID: http://www.w3.org/2003/05/soap-envelope/
Location: 97:52
Description: s4s-elt-invalid-content.1: The content of 'reasontext' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often.
The error seems to be coming from the SOAP schema. Any hints on how this can be fixed?


[/code]

Posted: Fri Oct 13, 2006 10:13 am
by sorin_ristache
Hello,

Yes the errors are in the SOAP 1.2 schema. You can fix them by adding the schemaLocation attribute to the import of the xml.xsd schema in the SOAP 1.2 schema:

Code: Select all

<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2004/10/xml.xsd"/>
Without a schema location attribute the parser does not know where to go to get the xml.xsd schema file. You cannot find the SOAP 1.2 schema in the <oXygen/> installation because the current version of <oXygen/> (7.2) includes the SOAP 1.0 schema.


Regards,
Sorin