You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "O'Leary, Don" <Do...@commerceone.com> on 2001/09/13 05:53:02 UTC
Validation and SOAP
Hi guys
I am using the Apache-SOAP 2_2 implementation to handle raw SOAP documents.
When I send the following Document to the server, all is OK and I get the
appropriate response.
------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
<SOAP-ENV:Body>
<ns1:getRate xmlns:ns1="urn:don:xml:soap:exchange"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<country1 xsi:type="xsd:string">USA</country1>
<country2 xsi:type="xsd:string">japan</country2>
</ns1:getRate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
----------------------------------------
With Apache-SOAP2_2 implementation, Validation default is set to "false".
However, I need to Validate !
When I change the source code of my SOAP to set validation="true" and I add
the following code to my SOAP-ENV
xsi:schemaLocation="http://www.nonExistentLocation nonExistentSchema.xsd"
The server output quiet rightly compains that it cannot find
"nonExistentSchema.xsd" BUT Apache-SOAP does not exit with error conditions.
ie Xerces fails Validation but Apache-SOAP returns with the appropriate SOAP
Response.
----------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getRateResponse xmlns:ns1="urn:don:xml:soap:exchange"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:float">144.52</return>
</ns1:getRateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------
Can anyone shed light on the above scenario.
Thanks in Advance.
Don