![]() |
JAX-RPC Dynamic Sample Application |
JAX-RPC Dynamic Sample Application
This document describes how to utilize the JAX-RPC Dynamic sample application in conjunction with the Sun ONE Application Server version 7.This sample application document contains the following sections:
Overview
Compiling and Assembling the Application
Deploying the Sample Application
Overview
This example shows you how to use the Java API for the XML-based RPC (JAX-RPC) to invoke a remote procedure using a dynamic invocation interface. The dynamic invocation interface (DII) mechanism allows a client to invoke a remote procedure, even if the signature of the remote procedure or the name of the service is unknown until runtime. Because of its flexibility, a DII client can be used in a service broker that dynamically discovers services, configures the remote calls, and executes the calls.If you want to experiment with a simple JAX-RPC application, see the JAX-RPC simple application.
For more information on the JAX-RPC and JAX-RPC dynamic invocation interface (DII) application, go to http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPC6.html.
You can find the source code for the sample application under <install_dir>/samples/webservices/jaxrpc/dynamic/src/samples/webservices/jaxrpc/dynamic
Compiling and Assembling the Application
To recompile, assemble, and deploy the application, see the Sample Application Build Facility document for details on using a build facility to quickly perform these tasks.For example, to rebuild the entire application from scratch, perform the following steps:
Compile and Assemble the J2EE Application.
Deploy the Application.
- Execute the asant command under <install_dir>/samples/webservices/jaxrpc/dynamic/src
- The default target core is executed to rebuild the .jar and .war files.
Clean the application project area.
- After you have re-created the sample application from scratch, proceed to Deploying the Sample Application.
Undeploy the Application.
- Execute the asant clean command to clean the application area.
Building Javadocs.
- Execute the asant undeploy command to undeploy the application.
- Execute the asant javadocs command to create javadocs.
- The Javadocs are created under <install_dir>/samples/webservices/jaxrpc/dynamic/javadocs.
Deploying the Sample Application
A pre-built jaxrpc-dynamic.war file is supplied with the application server installation. The pre-built jaxrpc-dynamic.war file is the Web Archive (.war) file of the application. Within the .war file resides the XML deployment descriptor files, application class files, and other content required by the application. You can use the pre-built .war file to deploy the application. If you want to experience compiling and assembling the application from scratch, follow instructions under Compiling and Assembling the Application.To deploy, the application administrative server needs to be running.
To start the administrative server if it is not already started:
For UNIX
Execute <install_dir>/domains/domain1/admin-server/startserv
For Windows
Start->Programs->Sun ONE Application Server 7->Start Application ServerSelect one of the following approaches to deploy the application:
Command Line-Based Deployment describes how to manually register the application using a Command Line Interface (CLI).
Web-Based Deployment describes how to use the web-based administration tool to deploy the sample application.
- This is the quickest means of deploying the application.
Command Line-Based Deployment
While Command Line Interface is the quickest means of deploying the application, if you want to experience deploying through a GUI tool, follow the instructions under the Web-Based Deployment section.CLI deployment of the application can be performed using either the asant script or the asadmin command.
The deployment process includes deploying the application .war file to the Sun ONE application server.
Deploy the application using the asant command:
>cd <install_dir>/samples/webservices/jaxrpc/dynamic/src
Deploy the application file using asadmin command:Execute the asant deploy command.
- It is an interactive command that might prompt you to provide the admin-server host, admin-server port, admin user name, admin password, and appserv instance.
>cd <install_dir>/samples/webservices/jaxrpc/dynamic
The deployment process involves the following operations:Execute the asadmin deploy -u <user-name> -w <password> -H <hostname> -p <admin server port> --instance <instance name> jaxrpc-dynamic.war command.
It authenticates against the local application server's administrative server.
The .war file is transferred to the administrative server.
The administrative server begins the registration process:
Parses the .war file.
Explodes the bits into the repository.
Registers the J2EE application jaxrpc-dynamic by updating the server.xml file.
- Now you are ready to run the application (see Running the Sample Application).
Log in to the web-based administration tool from the browser.
Click Deploy.
- Application Server Instances --> <server instance> --> Applications --> Web Apps
Click Browse to locate the jaxrpc-dynamic.war file. The file is located under <install_dir>/samples/webservices/jaxrpc/dynamic/.
Enter jaxrpc-dynamic in the Web Application Name field.
Enter jaxrpc-dynamic in the Context Root field.
Click the jaxrpc-dynamic link to verify that the application is deployed.
- Now you are ready to run the application (see Running the Sample Application).
Running the Sample Application
Perform the following steps to run the sample application:
>cd <install_dir>/samples/webservices/jaxrpc/dynamic/src
Execute the asant run command.
- The program should display the following line:
- A dynamic hello to Duke!
Troubleshooting
If you see a Connection refused error, when you do asant run, make certain that admin.host and sunone.instance.port in <install_dir>/samples/common.properties are correct.
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated July 11, 2002