Custom Schema Validation Policy - 8.0

Talend ESB Infrastructure Services Configuration Guide

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2024-03-13

The validation will be performed using an external customer schema.

The supported attributes are the following:

  • type - CustomSchema (if not specified, assumed as WSDLSchema),

  • path - URL, absolute or relative path to the custom schema,

  • appliesTo - consumer/provider/always/none,

  • message - request/response/all/none.

To enable Custom Schema Validation via policy, upload the following Schema Validation policy to the Service Registry and attach it to a service.

  • Remote URL schema location:

    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy" Name="wspolicy_schema_custom_validation">
        <wsp:ExactlyOne>
            <wsp:All>
                <tpa:SchemaValidation xmlns:tpa="http://types.talend.com/policy/assertion/1.0" type="CustomSchema" path="http://localhost:8080/CustomSchema.xsd" appliesTo="provider" message="request"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
  • Relative path from the root of the Talend Runtime Container:

    <wsp:Policy xmlns:wsp=">http://www.w3.org/ns/ws-policy" Name="wspolicy_schema_custom_validation">
        <wsp:ExactlyOne>
            <wsp:All>
                <tpa:SchemaValidation xmlns:tpa="http://types.talend.com/policy/assertion/1.0" type="CustomSchema" path="CustomSchema.xsd" appliesTo="consumer" message="response"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
  • Absolute path (not recommended, as it is operation system specific and requires that the path exists and is exactly equal on all machines.):

    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy" Name="wspolicy_schema_custom_validation">
        <wsp:ExactlyOne>
            <wsp:All>
                <tpa:SchemaValidation xmlns:tpa="http://types.talend.com/policy/assertion/1.0" type="CustomSchema" path="/opt/CustomSchema.xsd" appliesTo="consumer" message="response"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>