Create Web Services using axis and eclipse
For better
clarity, I will take you through one service creation and one client creation
using eclipse. For simplicity I will create a simple calculator service with 4
simple service functions.

--------------------------------------------------------------------------------------------------------
Step 1: Create a dynamic web project.
File -> New ->
Project ->



Press Finish and you have a new dynamic web
project.
Step 2: Create a simple Calculator class.
|
|
package
org.bpt.Services;
/**
?*
?* @author Boby Thomas
?*
?* Axis Service Sample.
?* Visit www.bobsindia.com
?*
?*/
public class
Calculator {
?????
????? public double
add(double arg1, double
arg2){
??????????? return
arg1 + arg2;
????? }
????? public double substract(double arg1, double arg2){
??????????? return
arg1 - arg2;
????? }
?????
????? public double
multiply(double arg1, double
arg2){
??????????? return
arg1 * arg2;
????? }
????? public double divide(double arg1, double arg2){
??????????? if(arg2
!= 0)????
????????????????? return
arg1 / arg2;
??????????? else return
-1;
????? }
}
|
|
Step 3: Create an axis service from this class.
Right click? Calculator.java
New
-> Other -> Web Service

Next

Click
on the link and select Axis 2.

Click
OK and click Next in Web service Dialog.


Now click on Start Server and wait for few
seconds.
Press
Next

Finish.
You have created a new axis service, deployed it and
started the server now.