Validate Action in IBM DataPower Gateway
The validate action can perform the following types of schema validation against incoming documents:
- Validate documents against a schema
- Validate documents with a schema attribute
- Validate documents with attribute rewrite rules
- Validate documents with encrypted sections
- Validate documents against a WSDL file
- Validate documents with a JSON schema
Validate:
Data validation is the process of ensuring that ingested data complies with specifications by comparing it to a pre-configured or pre-defined set of rules.
Validate Action:
- Drag the validate icon over to the path for configuration.
- Double-click the validate icon.
- To process, enter the message’s context in the input field.
- Choose the validation method from the list of schema validation methods.
- Validate documents against a schema
- Validate documents with a schema attribute
- Validate documents with attribute rewrite rules
- Validate documents with encrypted sections
- Validate documents against a WSDL file
- Validate documents with a JSON schema
- The validated document must be located in the local: directory for it to be accessed by validating the action.
- To specify whether to process asynchronously, set the asynchronous attribute.
- When enabled, the rule can move on to processing the next action without waiting for the previous one to finish.
- In the output field, specify the type that would process and sends the result to the next action.
- Click on Done.
Adding a validate action to validate XML request:
- Let’s create a sample loopback service to demonstrate the validated action functionality using XML firewall in IBM DataPower.
- Let’s create a sample XSD that validates the XML request.
- Upload the XSD file to the Datapower local directory.
- Create processing policy and processing rule.
- Drag the validate action onto the rule.
- Double-tap the validate icon and transform the action.
- Give the path of the XSD file in the schema URL field.
- Click Done, then configure the remaining services as needed
- Let’s take the sample success message using XSLT
- Click Done, then configure the remaining services as needed
- Test the service using any testing tool.
Adding a validate action to validate JSON request :
- Let’s create a sample loopback XML firewall service to demonstrate the validated action functionality.
- Let’s create a sample JSON schema that validates the JSON request.
- Upload the JSON file to the data power local directory.
- Create processing policy and processing rule.
- Drag the validate action onto the rule.
- Double-tap the validate icon.
- Give the path of the JSON file in the JSON schema URL field.
- Click Done, then configure the remaining services as needed
- Test the service using any testing tool.
Adding a validate action to validate the Document via the WSDL URL:
- Let’s create a sample loopback XML firewall service to demonstrate the validated action functionality.
- Let’s create a sample WSDL file that validates the given request.
- Upload the WSDL file to the data power local directory.
- Create processing policy and processing rule.
- Drag the validate action onto the rule.
- Double-tap the validate icon.
- Give the path of the WSDL file in the WSDL URL field.
- Click Done, then configure the remaining services as needed
- The service can be tested using any testing tool.
Adding a validate action to validate documents with schema attributes :
- According to the processing instructions in the document, this approach validates documents. Documents that don’t have processing instructions are regarded as valid.
- The document must provide the location of the schemas in order to pass validation using a schema attribute.
Adding a validate action to validate documents with attribute rewrite rules:
- Any schema reference in a document is rewritten using this technique, and the document is then checked against the rewritten schema reference. In most cases, the reference that has been changed refers to a local “trusted” copy of the schema.
- Choose the URL rewrite policy from the list of policies to rewrite the internal schema reference for validation with attribute rewrite rules. Adding a validate action to validate documents with encrypted sections
Adding a validate action to validate documents with encrypted sections
- This technique uses a schema exception map to validate partially encrypted documents. The dynamic schema for this action is generated by the map, which also contains a reference to a base schema.
- Choose the map to produce the dynamic schema for validation of partially encrypted documents from the schema exception map list.