JavaTM API for XML Registries (JAXR)
Sample Applications

Specification Version: 1.0
Reference Implementation (RI) Version: 1.0.8

jaxr-publish

This example, in the directory <JWSDP_HOME>/jaxr/samples/jaxr-publish, shows how to use the JAXR APIs to publish information about an organization to a registry, including information about services provided by the organization and contact information.

The example also illustrates how to classify registry entries using well-known classification schemes like the North American Industry Classification System (NAICS) and standard identifiers like the Dun & Bradstreet DUNS identifier.

Configuration

Before running the example, configure it as follows:
  1. By default, the example publishes information to the IBM test registry.

    You can publish to any registry you wish by setting the following properties in the publish.properties file:

    query.url: the URL for sending queries to the registry
    publish.url: the URL for publishing data to the registry
    Note: The URLs for the public registries can be found here: http://www.uddi.org/find.html

    To publish data to any of the public registries, you need to register first with the registry provider.

  2. If you are running the example from behind a firewall, add the proxy information by setting the following properties:
    http.proxy.host
    http.proxy.port
  3. Set the user.name and user.password properties to the user name and password you obtained when you registered with the registry provider.

Running the Sample

On Windows systems, at the prompt, type .\BLCM.

On UNIX systems, at the prompt, type ./BLCM.sh.

Results

You should see the following message for a successful run:

    Organization Saved

You may ignore the warning messages about PostalAddressMappings.

jaxr-query

This example, in the directory <JWSDP_HOME>/jaxr/samples/jaxr-query, shows how to use the JAXR APIs to query a registry for data -- specifically, how to query for an organization by name. The example also illustrates how to parse the retrieved information for details about the organization and the services it provides.

Configuration

Before running the example, configure it as follows:

  1. By default, the example queries for information from the IBM test registry. You can query any registry you wish by setting the following properties in the query.properties file:
    query.url: the URL for sending queries to the registry
    publish.url: the URL for publishing data to the registry

    The URLs for the public registries can be found here: http://www.uddi.org/find.html.

  2. If you are running the example from behind a firewall, add the proxy information by setting the following properties:
    http.proxy.host
    http.proxy.port
  3. You can edit the pattern being searched for by editing the settings for the company variable in the source code. By default, the sample uses the search string %USA%, which returns any name containing "usa" or "USA", including the organization published in the jaxr-publish sample.

Running the Sample

On Windows systems, at the prompt, type .\BQM.

On UNIX systems, at the prompt, type ./BQM.sh .

Results

You should see the following message for a successful run, followed by information about the registry entries retrieved:

    Successfully queried the registry for organizations matching ....

jaxr-browser

This is a more sophisticated example showing how to use the JAXR APIs to provide a common interface to heterogenous registries. The registry interactions using the JAXR APIs are all illustrated in the JAXRClient source code. The example is in the directory <JWSDP_HOME>/jaxr/samples/jaxr-browser.

Configuration

If you will run the browser from behind a firewall, make sure that you have set the http.proxyPort and http.proxyHost properties in the file <JWSDP_HOME>/conf/jwsdp.properties.

Running the Sample

The scripts for starting the browser are located under <JWSDP_HOME>/jaxr/bin.

  1. Use the following commands to start the browser:
  2. On Windows systems: .\jaxr-browser
    On UNIX systems: ./jaxr-browser.sh
  3. To override the values set in <JWSDP_HOME>/conf/jwsdp.properties, add the following arguments to specify proxy information:
    ./jaxr-browser.sh http-proxy-host http-proxy-port https-proxy-host https-proxy-port
    

    The entire command should be typed on one line.

Using the JAXR Browser

  1. Select a Registry Location URL. Use inquiry URLs for querying the registry. Use publishing URLs for publishing to the registry.

    Several of the commonly used URLs are preconfigured in the list, but you can also specify your own here.

  2. To query the registry, select the Browse panel, add the information, and click Search.

    To publish information to the registry, select the Submissions Panel. Make sure you have the publishing URL selected for the Registry Location. Fill in the information to publish and click Submit. It brings up an authentication dialog. Type the user name and password for your account on the registry and click OK to publish the entry to the registry.


Copyright © 2005 Sun Microsystems, Inc. All rights reserved.