Webservice for WS-Interoperability Samples Application

  Samples Index




Webservice for WS-Interoperability Sample Application


This document describes how to setup the Webservice to interoperate with clients coded using JAX-RPC APIs provided by different vendors. 

This document contains the following sections:



Overview

This document shows you how to deploy and run a simple webservice named InteropHelloWorld based on the Web Services for J2EE, version 1.1, on the Application Server. To learn more on how to code a webservice take a look at our jaxrpc-simple sample here.


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:


  1. Compile and Assemble the J2EE Application.

    Execute the asant command under <install_dir>/samples/webservices/interop/components/sun-webservice/.

    The default target core is executed to rebuild the .ear file.


  2. Deploy the application.

    After you have re-created the sample application from scratch, proceed to Deploying the Sample Application.


  3. Clean the application project area.

    Execute the asant clean command to clean the application area.


  4. Undeploy the application.

    Execute the asant undeploy command to undeploy the application.


  5. Build Javadocs.

    Execute the asant javadocs command to create Javadocs.

    The Javadocs are created under <install_dir>/samples/webservices/interop/components/sun-webservice/javadocs.



Deploying the Sample Application

A pre-built jaxrpc-interop.ear file is supplied with the application server installation. Within the .ear file resides the .xml deployment descriptor files, application class files, and other content required by the application. You can use the pre-built .ear file to deploy the application. If you want to compile and assemble the application from scratch, follow the instructions under Compiling and Assembling the Application.

To deploy the application, the administrative server needs to be running.

To start the administrative server if it is not already started:


For UNIX
Execute <install_dir>/bin/asadmin start-domain domain1


For Windows
Start->Programs->Sun Microsystems->J2EE 1.4 SDK->Start Default Server

Select one of the following approaches to deploy the application:


Command Line-Based Deployment

While Command Line Interface is the quickest means of deploying the application, if you want to deploy through a GUI tool, follow the instructions under the GUI 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 .ear file to the application server.

Deploy the application using the asant command:


  1. >cd <install_dir>/samples/webservices/interop/components/sun-webservice/


  2. 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.

Deploy the application file using the asadmin command:


  1. >cd <install_dir>/samples/webservices/interop/components/sun-webservice/

      Execute the command:
    asadmin
    deploy --user <username> --password <password> --host <host> --port <admin-port> jaxrpc-interop.ear

The deployment process involves the following operations:


GUI Based Deployment

Since a pre-built Enterprise Archive (.ear) file for the sample application is included with the application server, you can use the Admin GUI to quickly read in the .ear file and deploy it to the application server.

  1. Start the admin server if it is not already started. Here are the commands for each platform:
    1. Unix - Execute the <install_dir>/bin/asadmin start-domain domain1 command.
    2. Windows - Click "Start->Programs->Sun Microsystems->J2EE 1.4 SDK->Start Default Server"  command.
  2. Open the .ear file.
    1. Start Admin GUI, by entering URL  http://localhost:<admin.port>/asadmin   in browser. See replacing "localhost" and <admin.port> note here to determine correct values to use for your environment
    2. You are prompted to supply the user name and password of the application server. Enter correct values for your installed application server for "User Name:"  and "Password:" input fields, then click on the "Login" button.
    3. In the left-hand frame, click Applications-->Enterprise Applications  icon in the tree.
    4. In the right-hand frame, click on the "Deploy..."  button.
    5. Choose the file to be deployed by clicking on the "Browse..."  button, and navigate to select component to deploy (jaxrpc-interop.ear).
    6. In the browse dialog, click on the "OK"  button.
    7. In the right-hand frame, click on the "Next"  button.
    8. In the right-hand frame, click on the "OK"  button. (Optionally fill in remaining values for application to be deployed)
    9. In the left hand pane, you will see the newly deployed module's icon in the tree. In the right hand pane you will also see the component listed as deployed.

    Now you are ready to run the application (see Running the Sample Application).



Running the Sample Application

The webservice you just deloyed interoperates with clients using JAX-RPC APIs provided by different vendors. To select a client to talk (execute against)  with this webservice go here and follow the instructions on how to compile and execute a client.




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

Last Updated June11, 2004