Contents

The XMLVerification allows user to validate content present in the message body or application context or both, against configured XSD(s) or DTD(s).The component has two output ports OUT_PORT and FAILED_PORT. If the validation is successful then the message "without any changes" is sent out on OUT_PORT, else the message is sent on FAILED_PORT with two additional properties ERROR_MESSAGE and STACKTRACE containing the error message indicating the problem and the source of problem.

Content present in message body or application context or both is considered valid only if

  • The content has to be validated and is an XML instance.
  • The structure of XML instance is valid according to corresponding XSD/DTD configured.
  • The qualified root element of XML instance matches the configured qualified root element.

Configuration and Testing

The configuration for XML Verification is defined in the XMLVerification Configuration Property Sheet (CPS) as shown in Figure 1 with the Expert Properties view.

Component Configuration


Figure 1: Configuration of XML Verification

Attributes

Error Handling Configuration

The remedial actions to be taken when a particular error occurs can be configured here. Click on the ellipsis  button against this property to configure Error Handling properties for different types of Errors. By default, the options Log to Error Logs and Send to error port are enabled.

Please refer the Error Handling section in Common Configurations page for documentation.


Figure 3: Error Handling Configuration

Source(s) of content to validate

This property determines the source(s) of content that should be validated

  • Body - Only content of message body has to be validated with XSD/DTD defined against property Body. When this option is selected, property Body is visible and property Context is hidden.
  • Context - Only content of application context has to be validated with XSD/DTD defined against property Context. When this option is selected, property Context is visible and property Body is hidden.
  • Context-Body - Contents of both message body and application context have to be validated with XSD/DTD defined against properties Body and Context respectively. When this option is selected, both properties Context and Body are visible.
Structure for message body2 Body

This property defines the XSD/DTD with which content of message body has to be validated. Click ellipsis button to open the editor to provide XSD/DTD as shown in Figure 2.


Figure 2: Defining XSD / DTD

Functional Demonstration

Scenario

Validation of input XML based on the schema provided.

Configure the XMLVerification as described in Configuration section for XSD Structure Body and use feeder and display components to send sample input and to check the response respectively. If the Sample Input verification is successful, then the input message is sent to Display_Out and if the verification fails, the input message is sent to Display_False.


Figure 4: Demonstrating scenario with sample input and sample output

Useful Tips

When the XSD defines multiple imported schemas containing same target namespace, only the first schema is used for validation and any elements defined in other schema are identified by the component.

Adaptavist ThemeBuilder EngineAtlassian Confluence