Referencing Schematron in MDS for validation

In this recipe, we will show you how to reference Schematron defined in MDS to validate an incoming message within Mediator. This approach enables us to separate the validation rules for the actual composite, allowing us to change our validation rules without having to redeploy a compoite.

Getting ready

Make sure you have created a file-based MDS repository for JDeveloper, as described at the start of this chapter, and that it contains a valid Schematron file.

Create an SOA application with a project containing Mediator (see the Create a Mediator using a WSDL in MDS recipe in this chapter).

How to do it...

  1. Schematron validation of incoming messages within Mediator is specified at the routing rule level for an operation. Within JDeveloper, open the Mediator that you wish to apply the validation to. Click on the Schematron icon, circled in the following screenshot:
    How to do it...

    This will bring up the Validations window where you can specify one or more Schematron files for the routing rule.

  2. To add Schematron, click on the plus sign; this will bring up the Add Validation window shown here:
    How to do it...

    For Part, select the part of the SOAP message to which you want t apply the validation.

  3. Next click ,on the search icon (circled in the previous screenshot). This will launch the standard SOA Resource Browser window; select Resource Palette from the drop-down list.
  4. Select the Schematron that you wish to use and click on OK. This will return you to the Add Validation window.
  5. Click on OK; this will return you to the Validation window, which will now list our newly created validation. Click on OK, and this will return you to the Mediator editor.

How it works...

When we reference Schematron in this way, JDeveloper doesn't add a copy of Schematron to the composite; rather within the Mediator plan, it sets the schematron element to reference the location of Schematron in MDS.

At runtime, when the composite references Schematron, it will use the one deployed to the SOA infrastructure, MDS Database repository.

There's more...

This has a number of distinct advantages. Firstly, you can ensure that all your composites use the same version of a particular Schematron.

Secondly, if you need to modify your validation rules, you simply need to update a single copy of your Schematron and redeploy it to MDS. Any composite that references that Schematron will automatically pick up the modified version, without the need to be re-deployed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.216.254