Sunday 6 November 2016

Soap Request Schema Validation : mock Services

Below script can be placed under "OnRequest Script" of a mock service to automatically validate the XML Schema compliance to the corresponding incoming request.
The script validates the incoming request and incase the request does not comply to the Schema of the WSDL then an automated fault message is sent by the mock service on behalf of the incoming request. Implementation of this script can help us overcome the situation where we have to manually validate the request sent by application to the mock service to make sure it complies to the schema structure of the WSDL.




2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Nice script!

    When I run it against a non-valid incoming request, the script log shows the validation errors properly, but the soap-fault is always incomplete like this...

    The faultstring field in the soap-fault xml only contains:

    <![CDATA[VALIDATION ERRORS: [
    line 49:

    And the rest of the fault-response is even missing. Any idea why this fault-response is incomplete? It would be nice if we can see the complete fault-response in SoapUI Mock Service.

    Thnx in advance!

    ReplyDelete