Writing a Custom Validation Service  Locate

BEA AquaLogic Service Registry provides several ways to define and use validation services for taxonomies or identifier systems. For details about BEA AquaLogic Service Registry taxonomies, please see User's Guide, Taxonomy: Principles, Creation and Validation. This chapter focuses on custom validation services that you can deploy:

There are three different Java interfaces for validation services, one for each of the main UDDI data structures. These interfaces correspond to the WSDL Port Types of the Validation Service defined in the UDDI specification.

These interfaces are similar enough that we will only describe v3 validation. Your validation service must implement the interface UDDI_ValueSetValidation_PortType. This interface only has the validate_values method which has only one parameter, Validate_values. This parameter is a wrapper for real parameters: optional authInfo and basic UDDI data structures (businessEntities, businessServices, bindingTemplates, tModels and publisherAssertions) to validate. The validate_values method returns DispositionReport. If validation passes successfully, the DispositionReport should contain only one Result with errNo equals UDDIErrorCodes.E_SUCCESS.

Deploying Validation Service  Locate

Once the validation service is implemented, you can deploy the validation service locally on BEA AquaLogic Service Registry. To deploy the validation service on BEA AquaLogic Service Registry

  1. Create a classes subdirectory under REGISTRY_HOME/app/uddi/services/WASP-INF and copy the class file into this directory (with respect to subdirectories corresponding to packages).

  2. Shutdown BEA AquaLogic Service Registry, delete the REGISTRY/work directory, and restart BEA AquaLogic Service Registry.

For more information, please see the Demos, Validation. For details about the configuration of Validation Services, please see Administrator's Guide, Taxonomy Management

To deploy an external validation service, you must create a deployment package.

External Validation Service  Locate

This section shows you how to implement and package an external validation service that will be deployed to Systinet Server for Java 5.5. We show you how to package and deploy the ISBN validation service from the validation demo described in Validation. We assume you have already built the Validation demo.

[Note]Note

We also assume BEA AquaLogic Service Registry is installed in the REGISTRY_HOME folder and running at http://localhost:8080/ and that

Systinet Server for Java is installed in WASP_HOME folder and running at http://localhost:6060/

To package and deploy a validation service to Systinet Server for Java:

  1. Create a deployment package.

    Create the jar file ExampleValidation.jar with the following structure:

    Copy ISBNValidation.class from REGISTRY_HOME/demos/advanced/validation/build/classes to the package.

    Copy the wsdl and xsd files from REGISTRY_HOME/doc/wsdl to the package.

    Copy the package.xml file shown at Example 13 to the package.

  2. Deploy the validation package with required BEA AquaLogic Service Registry client packages into Systinet Server for Java 5.5.

    1. copy %REGISTRY_HOME%\dist\uddiclient_api_v3.jar %WASP_HOME%\app\system\uddi

    2. copy %REGISTRY_HOME%\dist\uddiclient_value_set_validation_v3.jar %WASP_HOME%\app\system\uddi

    3. copy ExampleValidation.jar %WASP_HOME%\app\system\uddi

  3. Shutdown the Systinet Server for Java, delete the WASP_HOME/work directory, and restart the Systinet Server for Java

Now you can upload the checked taxonomy from REGISTRY/demos/advanced/validation/data. For more information, please see User's Guide Uploading Taxonomies.

Modify the validation service endpoint as shown in Figure 10

Figure 10. Validation for Checked Taxonomy

Validation for Checked Taxonomy

You can run and test the validation service using Validation demo described in Validation.

Sample Files  Locate

Example 13.  package.xml

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://systinet.com/wasp/package/1.2"
    xsi:schemaLocation=
       "http://systinet.com/wasp/package/1.2 http://systinet.com/wasp/package/1.2"
    targetNamespace="http://my.org" version="1.0"
    name="ISBNValidation" client-package="false" library="false"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tns="http://my.org"

    xmlns:UDDIClient-value-set-validation-v3=
        "http://systinet.com/uddi/client/value-set-validation/v3/5.0">

<dependency ref="UDDIClient-value-set-validation-v3:UDDIClient-value-set-validation-v3" 
   version="5.0"/>
    <service-endpoint name="ISBNValidation"
        path="/ISBNValidation"
        service-instance="tns:ISBNValidationInstance"
    processing="UDDIClient-value-set-validation-v3:UDDIClientProcessing">
        <wsdl uri="uddi_vs_v3.wsdl" xmlns:wsdl="urn:uddi-org:vs_v3_binding" 
           service="wsdl:UDDI_ValueSetValidation_SoapService"/>
    </service-endpoint>
    <service-instance name="ISBNValidationInstance"
        implementation-class="demo.uddi.validation.ISBNValidation"
        preload="false" ttl="600" instantiation-method="shared"/>
</package>