Skip to main content

Custom Schema Validation Policy

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>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!