Advanced Inquiry - Range Queries  Locate

The Oracle Service Registry Range queries demos set demonstrates, how to use Oracle Service Registry inquiry enhancement - Range Queries. Oracle Service Registry range queries functionality allows you to search UDDI entities with the ability to use comparative operators (>, <) for matching keyValues in keyedReferences.

The demos set includes the following demo:

Prerequisites and Preparatory Steps: Code  Locate

We expect that you have already installed the Oracle Service Registry and set the REGISTRY_HOME environment variable to the registry's installation location.

To run the Oracle Service Registry's demos, your registry must be running.

It is necessary to configure the demos. The configuration system has two levels: global and local. The properties defined at the global level may be overwritten at the local level. The global properties are located in the file:

Windows: %REGISTRY_HOME%\demos\env.properties
UNIX: $REGISTRY_HOME/demos/env.properties

The values set during the installation of the Oracle Service Registry work out of box, and their modification affects all demos. If you need to redefine the value of some property for a single demo (that is, at the local level), edit env.properties. This file is located in the same directory as the file run.sh (run.bat). Local level properties for the Advanced Inquiry demos are loaded from the file:

Windows: %REGISTRY_HOME%\demos\advanced\inquiry\env.properties
UNIX: $REGISTRY_HOME/demos/advanced/inquiry/env.properties

Table 7. Properties Used in Demos

NameDefault ValueDescription
uddi.demos.result.max_rows5limit of data returned from registry
uddi.demos.url.inquiryExthttp://localhost:8888/registry/uddi/inquiryExtthe extended inquiry web service port URL

Presentation and Functional Presentation  Locate

This section describes the programming pattern used in demos using the FindBusiness demo as an example. You can find its source code in the file:

Windows: %REGISTRY_HOME%\demos\advanced\inquiry\src\demo\uddi\rq\FindBusiness.java
UNIX: $REGISTRY_HOME/demos/advanced/inquiry/src/demo/uddi/rq/FindBusiness.java

The helper method createFindBusiness creates a FindBusiness structure:


public Find_business createFindBusiness(String tModelKey, String keyValue,
                                        String operator, String quantifier)
        throws InvalidParameterException {
    System.out.println("tModelKey = " + tModelKey);
    System.out.println("keyValue = " + keyValue);
    System.out.println("operator = " + operator);
    System.out.println("quantifier = " + quantifier);

    Find_business find_business = new Find_business();
    QualifiedKeyedReference qualifiedKeyedReference = new QualifiedKeyedReference();
    qualifiedKeyedReference.setTModelKey(tModelKey);
    qualifiedKeyedReference.setKeyValue(keyValue);
    qualifiedKeyedReference.setFindQualifierArrayList(parseFindQualifiers(operator, quantifier));
    find_business.setCategoryBag(new CategoryBag(new KeyedReferenceArrayList(qualifiedKeyedReference)));
    find_business.setMaxRows(new Integer(MAX_ROWS));

    return find_business;
}
        

The findBusiness method performs the searching operation:


public BusinessList findBusiness(Find_business find_business) throws UDDIException, SOAPException {
    System.out.print("Check structure validity .. ");
    try {
        find_business.check();
    } catch (InvalidParameterException e) {
        System.out.println("Failed!");
        throw new UDDIException(e);
    }
    System.out.println("OK");

    UDDI_Inquiry_PortType inquiry = getInquiryStub();
    System.out.print("Search in progress ..");
    BusinessList businessList = inquiry.find_business(find_business);
    System.out.println(" done");
    return businessList;
}
        

Building and Running Demos  Locate

This section shows, how to build and run the Oracle Service Registry Advanced Inquiry demo set. Let us continue with our FindBusiness demo.

  1. Be sure that the demo are properly configured and the Oracle Service Registry is up and running.

  2. Change your working directory to

    Windows %REGISTRY_HOME%\demos\advanced\inquiry
    UNIX $REGISTRY_HOME/demos/advanced/inquiry

  3. Build demo using:

    Windows:UNIX:
    run.bat make./run.sh make

    [Note]Note

    When compiling demo on Windows platforms, you may see the following text:

    A subdirectory or file ..\..\common\.\build\classes already exists.

    . This is expected and does not indicate a problem.

  4. To get list of all available demos, run

    Windows: run.bat help
    UNIX: ./run.sh help

  5. The selected demo can be executed via the run command using the name of the demo as a parameter. For example, to run the FindBusiness demo, invoke

    Windows: run.bat FindBusiness
    UNIX: ./run.sh FindBusiness

    The output of this demo will resemble the following:

    
    Searching for businesses by category where keyedReference
    Enter tModelKey [uddi:systinet.com:demo:location:floor]:
    Enter keyValue [1]: 3
    Enter operator (=,<,>,<=,>=,<>) [=]:>
    Enter quantifier (exists,notExists) [exists]:
    tModelKey = uddi:systinet.com:demo:location:floor
    keyValue = 3
    operator = >
    quantifier = exists
    Check structure validity .. OK
    Using Inquiry at url http://van.in.idoox.com:8888/registry/uddi/inquiryExt .. done
    Search in progress .. done
    
    Displaying 1 of 1, starting at position 1
    Business 1 : uddi:systinet.com:demo:it
    <businessInfoExt businessKey="uddi:systinet.com:demo:it" xmlns="http://systinet.com/uddi/api/v3/ext/5.0">
      <name xmlns="urn:uddi-org:api_v3">IT</name>
      <description xmlns="urn:uddi-org:api_v3">IT department</description>
      <serviceInfos xmlns="urn:uddi-org:api_v3">
        <serviceInfoExt serviceKey="uddi:systinet.com:demo:it:support" businessKey="uddi:systinet.com:demo:it" xmlns="http://systinet.com/uddi/api/v3/ext/5.0">
          <name xmlns="urn:uddi-org:api_v3">Support</name>
          <description xmlns="urn:uddi-org:api_v3">Telephone support</description>
          <bindingTemplates xmlns="urn:uddi-org:api_v3">
            <bindingTemplate bindingKey="uddi:b77eb8f0-86ce-11d8-ba05-123456789012" serviceKey="uddi:systinet.com:demo:it:support">
              <description>IT related issues shall be reported there</description>
              <accessPoint useType="endPoint">tel:+1-123-456-7890</accessPoint>
              <tModelInstanceDetails>
                <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:telephone"/>
              </tModelInstanceDetails>
            </bindingTemplate>
          </bindingTemplates>
        </serviceInfoExt>
        <serviceInfoExt serviceKey="uddi:systinet.com:demo:hr:employeesList" businessKey="uddi:systinet.com:demo:hr" xmlns="http://systinet.com/uddi/api/v3/ext/5.0">
          <name xmlns="urn:uddi-org:api_v3">EmployeeList</name>
          <description xmlns="urn:uddi-org:api_v3">wsdl:type representing service</description>
          <bindingTemplates xmlns="urn:uddi-org:api_v3">
            <bindingTemplate bindingKey="uddi:5c546520-78b8-11d8-bec4-123456789012" serviceKey="uddi:systinet.com:demo:hr:employeesList">
              <description>wsdl:type representing port</description>
              <accessPoint useType="http://schemas.xmlsoap.org/soap/http">urn:unknown-location-uri</accessPoint>
              <tModelInstanceDetails>
                <tModelInstanceInfo tModelKey="uddi:systinet.com:demo:employeeList:binding">
                  <instanceDetails>
                    <instanceParms>EmployeeList</instanceParms>
                  </instanceDetails>
                </tModelInstanceInfo>
                <tModelInstanceInfo tModelKey="uddi:systinet.com:demo:employeeList:portType">
                  <instanceDetails>
                    <instanceParms>EmployeeList</instanceParms>
                  </instanceDetails>
                </tModelInstanceInfo>
              </tModelInstanceDetails>
              <categoryBag>
                <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi.org:xml:namespace" keyValue="http://systinet.com/wsdl/demo/uddi/services/"/>
                <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi.org:wsdl:types" keyValue="port"/>
                <keyedReference tModelKey="uddi:uddi.org:xml:localName" keyName="uddi.org:xml:localName" keyValue="EmployeeList"/>
                <keyedReference tModelKey="uddi:systinet.com:taxonomy:endpoint:availability" keyName="Available" keyValue="Available"/>
                <keyedReference tModelKey="uddi:systinet.com:taxonomy:endpoint:status" keyName="Operational" keyValue="Operational"/>
              </categoryBag>
            </bindingTemplate>
          </bindingTemplates>
        </serviceInfoExt>
      </serviceInfos>
      <contactInfos>
        <contactInfo useType="Technical support">
          <personName xmlns="urn:uddi-org:api_v3">John Demo</personName>
        </contactInfo>
      </contactInfos>
    </businessInfoExt>
    
    ********************************************************