![]() |
JAXR Sample Application |
JAXR Sample Application
This document describes how to utilize the JAXR sample application in conjunction with Sun ONE Application Server version 7.This sample application document contains the following sections:
Overview
Compiling and Assembling the Application
- Provides a brief overview of Java API for XML Registries.
Deploying the Sample Application
- Describes how to compile and assemble the application.
Running the Sample Application
- Describes how to configure the application to access various registry servers.
Troubleshooting
- Describes how to use various services provided by the application.
- Provides remedies for common questions.
Overview
The purpose of this document is to demonstrate the support for the Java API for XML Registries in the Sun ONE Application server. This document describes how to compile, assemble and run various components of the JAXR application.An XML registry is an infrastructure that enables the building, deployment, and discovery of Web services. The Java API for XML Registries (JAXR) provides a uniform and standard Java API for accessing different kinds of XML Registries.
The high-level architecture of JAXR consists of the following parts:
A JAXR client that uses the JAXR API to access a registry via a JAXR provider.
A JAXR provider that implements the RegistryService interface and other interfaces to allow a client to access registries. The provider provides registry access and registry object interfaces.
The purpose of this application is to address the JAXR client. For more information on JAXR, go to: java.sun.com/xml/jaxr/index.html.
The application has nine main Java classes that communicate with the JAXR provider. Each class has a makeConnection method to get the connection to the registry. There is a wrapper client class that reads input from the user or from asant, and calls one of the JAXR client classes accordingly. The source code is located at: <install_dir>/samples/webservices/jaxr/src/samples/webservices/jaxr/service/
and <install_dir>/samples/webservices/jaxr/src/samples/webservices/jaxr/client/.
Compiling and Assembling the Application
This section contains instructions to build and assemble the JAXR sample application using the Command Line Interface. See the Sample Application Build Facility document for details on using a build facility.To rebuild the entire application from scratch, follow these steps:
Compile and assemble the application. For example:
After you have re-created the sample application from scratch, proceed to Deploying the Sample Application.
Build Javadocs. For example:
- Execute the asant command under <install_dir>/samples/webservices/jaxr/src/
- The default target core is executed to compile Java files and rebuild the .jar file. The .jar file has the JAXR API classes and a wrapper client class.
Clean the web application project area. For example:
- Execute asant javadocs command under <install_dir>/samples/webservices/jaxr/src/ to create javadocs.
- The Javadocs are created under <install_dir>/samples/webservices/jaxr/javadocs.
Deploy the sample application.
- Execute the asant clean command under <install_dir>/samples/webservices/jaxr/src/ to clean the application build and assemble area.
Deploying the Sample Application
The Java API for XML Registries can be configured to access various registries. You can use either your own registry server or you can use public registry servers. If you choose to use a public registry server, make certain that you can publish to the registry server.Please modify <install_dir>/samples/webservices/jaxr/src/jaxr.properties with the correct parameters.
If you wish to publish to the registry server, modify the publish organization info section under <install_dir>/samples/webservices/jaxr/src/jaxr.properties, if required.
You may now proceed to Running the Sample Application.
Running the Sample Application
The sample application provides capabilities of querying, publishing to, and deleting from various registries. A pre-built .jar file is provided for running the application without compiling. Separate targets are provided to perform these activities.Before running the application, make certain that you have followed the Deploying the Sample Application instructions to configure the application for the registry server you wish to use.
Querying Registry
This functionality allows user to search organizations in the registry for some input string.
Querying Registry Server for WSDL Services
This functionality allows the user to search organizations in the registry that offer services based on technical specifications that take the form of WSDL documents.
Querying Registry Server for NAICS classification
This functionality allows the user to search a registry for organizations using an NAICS classification.
Publishing an Organization to Registry
This functionality allows the user to publish organizations to the registry. Modify the publish organization info section in <install_dir>/samples/webservices/jaxr/src/jaxr.properties with the appropriate information.
Deleting an Organization from Registry
This functionality allows the user to delete an organization from the registry.
>cd <install_dir>/samples/webservices/jaxr/src/
Creating a classification scheme in Registry
This functionality allows the user to create a classification scheme and save it to the registry.
Deleting a classification scheme from Registry
Publishing an Organization with postal address to Registry
This functionality allows the user to publish organization with a contact person having postal address to the registry.
Be sure that you have executed run-save-scheme before trying this operation.
Please edit <install_dir>/samples/webservices/jaxr/src/postalconcepts.xml and replace uuid-from-save with the value returned by run-save-scheme operation.
Please edit <install_dir>/samples/webservices/jaxr/src/jaxr.properties and specify correct uuid-string.
>cd <install_dir>/samples/webservices/jaxr/src/
Execute the asant run-publish-postal command.
Querying Registry for organizations with postal address
This functionality allows user to search organizations in the registry for some input string. It displays the postal addresses the contacts of the organizations using the classification scheme created by run-save-scheme operation.Please edit <install_dir>/samples/webservices/jaxr/src/jaxr.properties and specify correct uuid-string.
Retrieving objects owned by a user from Registry
This functionality allows user to retrieve all the objects in the registry, owned by a user.
Command line Help
This target provides help on all of the above commands with examples. Try asant help under <install_dir>/samples/webservices/jaxr/src/.If you want to override the jaxr.properties file, you can use command line arguments with asant commands.
For example, asant run-query -Dquery-string=Test
runs the command run-query and searches in the registry for query-string Test.
While running the sample, if you see the unknownUser error, verify the username and password.
While running the sample, if you see a no protocol or bad response error, verify that the query-url and publish-url are correct.
If you are unable to delete from the registry server and you see the invalidKeyPassed error, make certain that you are providing the correct key for the organization.
The following are the query-url and the publish-url for the IBM public registry server:
query-url=http://uddi.ibm.com/testregistry/inquiryapi
The following are the query-url and the publish-url for the Microsoft public registry server.publish-url=https://uddi.ibm.com/testregistry/protect/publishapi
Some Known Issues:
- The application will not work, if there is firewall between the Registry Server and the Application Server. Please manually edit the source files to specify http proxy server. Please look at Java TM Web Services JAXR Tutorial for more information.
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated July 25, 2002