Page 1 of 1

How to validate soap response using multiple schema ?

Posted: Mon Jun 24, 2013 4:20 pm
by abdullah
Hello,

I use Oxygen ( Professional version ) , I have the following soap response ( fault contains custom elements) :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://xyz.gov/ErrorStructure/xml/schemas/version2.0"
xmlns:ns2="http://xyz2.gov/Service/version/1.0">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>1234</faultcode>
<faultstring>Error</faultstring>
<faultactor/>
<detail>
<ns2:commonError>
<ns1:Source>SA</ns1:Source>
<ns1:ErrorType>Business Error</ns1:ErrorType>
</ns2:commonError>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I know how to validate it against one schema at a time ( using enveleop.xsd from the toolbar menu ) , but how can I validate it against multiple schemas ( SOAP-ENV , ns1 and ns2 ) , I cannot choose more than one at a time?

Or if there is a solution through xml code , it's fine.

Image

Thanks

Re: How to validate soap response using multiple schema ?

Posted: Mon Jun 24, 2013 5:07 pm
by iulian_velea
Hello Abdullah,

Instead of using Validate with action from the toolbar, you should use a validation scenario. You can define a validation scenario for your file by pressing the Configure validation scenario action from the toolbar or the Document/Validate menu.
A validation scenario is a collection of validation units, each one describing a separate validation operation on its own.
The validation parameters that can be configured in a validation unit are:
  • URL of the file to be validated. In your case this should remain ${currentFileURL} which is a variable that gets expanded at validation time to the URL of the file you are applying the scenario on.
  • File type, which I guess should be XML Document.
  • Validation engine. Leave this also as it is - Default engine.
  • Automatic validation, which controls whether the validation unit is used in the case of Automatic validation operation performed by oXygen on file modifications, for example.
  • Schema. This represents the URL of the schema used when this validation unit is executed. This is the parameter that you need to use if you want a custom schema.
So if you want to validate against multiple schemas, as you mentioned, you must add several validation units to the validation scenario associated with your file, each one using a different schema.
Here is a link to oXygen documentation describing in more details how to configure such a scenario:
http://www.oxygenxml.com/doc/ug-editor/ ... arios.html

Regards,
Iulian

Re: How to validate soap response using multiple schema ?

Posted: Wed Jun 26, 2013 7:48 pm
by abdullah
Thanks Iulian,I found it.