The The Validate Mediator is used for schema validation of messages. A selected part of an XML message is validated validates XML messages against a specified schema. This mediator can be extended by adding properties to enable/disable specific features of the validation engineYou can specify an XPath to extract and validate a specific part of the message. Otherwise, the mediator validates the first child of the SOAP body of the current message.
Tip |
---|
A Fault Mediator should be added as a child to the Validate mediator in order specify the fault sequence to be followed if the validation fails. |
...
Parameter Name | Description | |||||
---|---|---|---|---|---|---|
Schema keys defined for Validate Mediator table | This parameter is used to specify the The key for the schema location. It can be specified using one of the following methods.
Click Add Key to add a new schema key. Click Delete in the relevant row to delete a schema key.
| |||||
Source | The XPath expression to extract the XML that needs to be validated. The Validate mediator validates the evaluation of this expression is validated against the schema specified in the Schema keys defined for Validate Mediator table. If this is not specified, the validation is performed against the first child of the SOAP body of the current message.
|
...
Parameter Name | Description |
---|---|
Feature Name | The name of the feature. |
Value | This parameter is used to specify whether the feature should be enabled or not. Click True to enable and Click True to enable the feature, or click False to disable the feature. |
Action | Click Delete in the relevant row to delete a feature. |
...
In this example, the required schema for validating messages going through the validate mediator is given as a registry key, schema\sample.xsd
. No source attribute is specified, and therefore the schema will be used to validate the first child of the SOAP body. The mediation logic to follow if the validation fails is defined within the on-fail
element. In this example, the Fault Mediator is used to create creates a SOAP fault to be sent back to the party which sent the message.
...