BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Compile, Publish, and Test the Web Service

Exercise

In this lab you will compile, publish and test the web service code you created in the previous labs in this section using Apache Tomcat/Axis.

Prerequisites

Objectives

  • Discover how to compile, publish and test the web service.

Setup Tasks

Open the web service code generated in the previous labs (see Prerequisites), or download the file (ZIP).

Note: Ensure the remote administrator is enabled in Apache Axis

Tasks

  1. Package the web service code in a jar file using the % jar cvf calc.jar calculator/ws/ command.
  2. Move the calc.jar file to the %TOMCAT_HOME%/webapps/axis/WEB-INF/lib folder.
  3. Verify that the Axis libraries are in your class path.
  4. Make sure the Tomcat application server is running.
  5. Using the Apache Axis Admin Client, deploy the web service using the following command:
        % java org.apache.axis.client.AdminClient deploy.wsdd command.
  6. Download the file CalcClient.java that invokes the calculator web service operations.
  7. Compile and run the CalcClient.java file to produce the following output:
        1 + 2 = 3.0
        5 – 1 = 4.0

Check Your Work

Download the completed code (JAR).

Additional Labs

Back to the Developer Lab Main Menu

 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.