Service Registry 3 2005Q4 Developer's Guide

About the Examples

Many sample client programs that demonstrate JAXR features are described in this manual. To obtain these examples, go to the following URL: http://www.sun.com/products/soa/registry/#faq/. A zip file that contains the examples is available in the Resources section.

Download the zip file to any convenient location on your file system. After you unzip the file, the example source code is in the directory <INSTALL>/registry/samples, where <INSTALL> is the directory where you unzipped the examples.

Each example or group of examples has a build.xml file that allows you to compile and run each example using the asant tool. Each build.xml file has a compile target and one or more targets that run the example or examples. Some of the run targets take command-line arguments.

The asant command is in the Sun Java System Application Server bin directory, which is usually /opt/SUNWappserver/appserver/bin/ in the SolarisTM Operating System and /opt/sun/appserver/bin on Linux systems.

Before you run the examples, you must edit two files in the directory <INSTALL>/registry/samples/common. The file build.properties is used by the asant targets that run the programs. The file JAXRExamples.properties is a resource bundle that is used by the programs themselves.

In addition, a targets.xml file in the <INSTALL>/registry/samples/common directory defines the classpath for compiling and running the examples. It also contains a clean target that deletes the build directory created when each example is compiled. You do not need to edit this file.

ProcedureTo Edit the build.properties File

Steps
  1. Set the property container.home to the location of the container where the Registry is deployed.

    This is the location of your installation of the Sun Java System Application Server Enterprise Edition 8.1. By default, this location is /opt/SUNWappserver on Solaris systems and /opt/sun/appserver on Linux systems.

  2. Set the property registry.home to the directory where the Registry is installed.

    This directory is /opt/SUNWsoar on Solaris systems and /opt/sun/SUNWsoar on Linux systems.

  3. Set the property registry.domain.home to the directory where the Registry domain is installed.

    This directory is /var/opt/SUNWsoar/domains/registry on Solaris systems and /var/opt/sun/SUNWsoar/domains/registry on Linux systems.

  4. Set the property proxyHost to the name of the system through which you access the Internet, if you are behind a firewall.

    If you are not sure what the value should be, consult your system administrator or another person with that information. The proxyPort value is set to 8080, the typical value; change this value if necessary.

ProcedureTo Edit the JAXRExamples.properties File

Steps
  1. Edit the properties query.url and publish.url to specify the URL of the Registry.

    The file provides a default setting of localhost:6060 for the host and port. Change this setting to another host or port if the Registry is installed on a remote server or at a non-default port.

  2. Edit security properties to specify the properties that are required for publishing to the Registry. Make these edits after you use the User Registration Wizard of the Web Console. See Getting Access to the Registry for details.

  3. Feel free to change any of the data in the remainder of the file as you experiment with the examples.

    The asant targets that run the client examples always use the latest version of the file.