Validate XML
The Validate XML task is used to validate message data, a WSDL message, XML text, binary, or XML tree formats against a schema.
The output of the Validate XML task is contributed to the mediation exchange, and can be used by downstream tasks. Validate XML processes an XML document against an XML schema, to report any errors found. It does not produce a parsed tree.
You choose the schema against which validation is to be performed by first specifying its reference type in the General tab of the Validate XML task:
- A static reference enables you to select a single (static) schema from a folder that is in your project.
- A dynamic reference enables you to select a set of schemas from a folder that is in your project. At run-time one of the schemas in the list are used dynamically for validation, based on the input to the mediation task. When you specify a folder for dynamic reference, ActiveMatrix Service Grid recursively includes the schemas under this folder and its sub-folders
General Tab
On the General tab you specify a name and description for the task, and specify the type of schema to be used during verification.
Field | Description |
---|---|
Name | Assign a name to the task, to identify the task in the mediation flow. This name appears in the tooltip that opens when you hover the cursor over the task icon in the mediation flow. |
Description | Describe the task briefly. This description appears in the tooltip that opens when you hover the cursor over the task icon in the mediation flow. |
Throw Fault on Validation Error |
When this option is set, an error in the Validate XML task results in a MediationTaskFault. When this check box is not selected, an error in the Validate XML task produces output that contains two fields: valid has two values: true if the XML is valid; false if the XML is invalid. error appears if the XML validation fails, and contains an errorCode and an errorMessage. These codes follow the W3C specification for XML schema. |
Input | Select the input type:
|
Schema Reference Type | When you select an input type of Text, Binary, or XML Tree, you can choose a static or dynamic reference type:
|
Schema Element or Schema Folder | This field is based on whether you choose a static or dynamic reference type:
|
Input Tab
The content of the Input tab depends on the Input type you selected on the General tab.
Field | Description |
---|---|
MessageData | No mapping is required in the Input tab. |
WSDL Message | Displays a message tree corresponding to the operation and message selected in the General tab. |
Text |
Specify the
If you chose a
Dynamic Reference Type in the
General tab, you can specify an optional
|
Binary |
Specify the
If you chose a
Dynamic Reference Type in the
General tab, you can specify an optional
|
Tree |
In the
If you chose a
Dynamic Reference Type in the
General tab, you can specify an optional
|
Output Tab
The Output tab of the Validate XML task shows the results of the validation, indicating whether the incoming XML is valid or invalid, after being verified against the specified schema.
If validation fails, an error description identifies the cause of the failure. You can log this error description for design-time troubleshooting.
If the Throw Fault field is selected, no output is produced by this task. The Output tab shows a tree with the message No Output Configured.