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


Implement the Server Code

Exercise

Building on the previous labs, in this exercise you will implement the server code for the web service.

Prerequisites

Objectives

  • Discover how to implement the server code.

Setup Tasks

Open the CalculatorSoapBindingImpl.java file that you created previously. Or download the file (JAVA).

Tasks

  1. Modify the file to resemble the following code fragment:
      package calculator.ws;
      public class CalculatorSoapBindingImpl implements calculator.ws.Calculator { 
          public double add(double in0, double in1) throws java.rmi.RemoteException
          {
              return in0 + in1; 
          }
          public double subtract(double in0, double in1)throws java.rmi.RemoteException
          {
              return in0 – in1;
          }
      }
  2. Save the file.
  3. Compile the server code.

Check Your Work

Download the completed code (JAVA).

Additional Labs

Go to the next exercise in “Building a Calculator Web Service Using Apache Tomcat/Axis”, Compile, Publish and Test the Web Service.

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.