Using the WS-Schema Validation Policy
Learn about the WS-Schema Validation Policy Assertion and policy configuration options.
Note: This policy is only available in Policy Manager version 7.0 or later.
Supported Platforms: 7.x, 8.0
Table of Contents
A common integration problem in an SOA occurs when consumers send messages to services that don’t conform to the service's message schemas. Typically this is caused by the versioning of a service’s schema and a consumer sending a message defined in the prior schema version. However, it can also be a consumer's malicious attempt to cause a denial of service by sending invalid messages to a service.
A Manageability Container can help by validating the messages exchanged between the consumers and services against the service’s published schema.
Configuring the container to perform schema validation of messages is performed by defining the schema validation policies. The policies indicate which messages to validate and possibly indicate additional schemas to validate against that might not be defined in the service’s WSDL document. Additional schemas are typically required when validating expected headers in a bound (SOAP) message.
Schema Validation Behavior
- If schemas are not selected as part of the policy configuration, the policy validates based on the schema or schemas in the WSDL. This is default behavior.
- If schemas are selected in the policy configuration and also exist in the WSDL, the policy validates the selected schemas in the policy configuration and the schema or schemas in the WSDL.
The policy includes the configuration options listed below.
|Select Schemas||Displays a list of schemas that are available in the file system, that can be selected and added to the policy.|
Select Lax or Strict XML validation mode.
Lax: Validates only the XML elements that have a namespace that matches a namespace of an associated schema. Elements with no namespace, or those that do not have a namespace that matches a schema namespace, are skipped and not validated. Lax validation is less stringent than strict validation, and is the default validation type.
Strict: Validates all XML elements against the applied schemas. Each XML element must have a namespace that matches a namespace of an associated schema, or validation fails.
Let's take a quick walkthrough of the WS-Schema Validation Policy Policy configuration process to get you started.
Step 1: Add Policy / Use System Policy
In Policy Manager, to create a WS-Schema Validation Policy instance, go to Policies > Operational Policies and choose Add Policy.
Step 2: Modify Policy
When you click Modify to make changes to the WS-Schema Validation Policy on the Policy Details page, the initial policy looks like this:
Step 3: Configure
Configuring the WS-Schema Validation Policy is one step in a larger process.
To configure the WS-Schema Validation Policy:
- Select the schemas you would like to add to the policy in the left column, and use >> to copy them to the right column.
- Select the validation mode (Lax or Strict).
- Review the usage scenarios for each validation mode for the complete process and follow the applicable steps.
Step 4: Attach Policy
After you've saved your policy, you can attach it to a web service or you can attach the policy at the Organization level and the policy will be active for all services defined within the organization.