JavaTM API for XML Registries (JAXR)
Sample Applications

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

jaxr-publish

This example shows how to use the JAXR APIs to publish an organization's information 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. If you are running the example from behind a firewall, add the proxy information by modifying the following fields in the publish.properties file:
  2. http.proxy.host
    http.proxy.port
  3. By default, the registry attempts to publish information to Microsoft's public UDDI v2 test registry.

    You can publish to any registry you wish by setting the following variables:

    query.url: the URL for sending queries to the registries
    publish.url: the URL for publishing data to the registries
    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.

    For the private UDDI V2 registry implementation bundled with the JWSDP, the URLs are

    query.url: http://localhost:8080/RegistryServer/
    publish.url: http://localhost:8080/RegistryServer/
  4. Next, you need to provide the username and password for publishing to the registry. To do this, set the user.password and user.name variables appropriately. For the public registries, you can obtain this data during the registration process mentioned in Step 2. For the private registry bundled with the Java WSDP, use "testuser" for both the username and password (without the quotes).

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 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. If you are running the example from behind a firewall, add the proxy information by modifying the following fields in the query.properties file:
  2. httpProxyHost
    httpProxyPort
  3. By default, the registry attempts to query information from Microsoft's public UDDI v2 test registry. You can query any registry you wish by setting the following variables:
  4. regUrli: the URL for sending queries to the registries
    regUrlp: the URL for publishing data to the registries
    The URLs for the public registries can be found here: http://www.uddi.org/find.html.

    For the private UDDI V2 registry implementation bundled with the Java WSDP, the URLs are

    regUrli: http://localhost:8080/RegistryServer/
    regUrlp: http://localhost:8080/RegistryServer/
  5. You can edit the pattern being searched for by editing the settings for the "company" variable. For example, to search for the organization published in the jaxr-publish sample, you could replace %foo% with USA-Works.

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:
    "Successfully queried the registry for organizations matching ...."
followed by information about the registry entries retrieved.

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.

Configuration

If you are running the browser behind a firewall, specify the command line arguments as shown in the section "Running the sample".

Running the sample

The scripts for starting the browser are located under <JWSDP_HOME>/jaxr/bin .
  1. Use the following commands if you are not running the samples from behind a firewall.
  2. On Windows systems: .\jaxr-browser
    On Unix systems: ../jaxr-browser.sh
  3. If you are running these samples from behind the firewall, add the following arguments to specify proxy information:
  4. ./jaxr-browser.sh http-proxy-host http-proxy-port https-proxy-host https-proxy-port
Notes: 1. The entire command should be typed on one line.
2. For Windows systems, use .\jaxr-browser instead of ./jaxr-browser.sh.

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 on "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 on "Submit". It brings up an authentication dialog. Type in the username and password for your account on the registry and click on "OK" to publish the entry to the registry.

For complete details on the browser usage, refer to the Web Services Tutorial.