|
|
Within few minutes, you will learn how to create an axis2 web service using the eclipse IDE in just 3 easy steps.
The 3 steps are:
| 3.4 or higher | |
| Java | 1.5 or higher |
| WSO2 WSAS | 3.1.x |
| eclipse features |
Note: Visit the resources section of this tutorial to find out from where to download the prerequisites or click the above links.
Go to File->New->Other... (Or "Ctrl + N")
Select Dynamic Web Project.
Type in a "Project name"
In "Target runtime" if "WSO2 WSAS 3.1" not available, click "New"
Select "WSO2 WSAS 3.1" from the list and click next.
Specify WSAS distribution path.
Click "Finish"
In "Configuration" click "Modify"
Tick/Check "WSAS Web Services" and click OK
Click "Finish"
Go to File->New->Other... (Or "Ctrl + N")
Select "Class" and click "Next"
Put the package name and name of the class
Click "Finish"
Lets have the following code.
package org.wso2.sample.webservice;
public class Area {
public double getSquare(double sideLength){
double area=sideLength*sideLength;
return area;
}
public double getRectangle(double width, double height){
double area=width*height;
return area;
}
public double getTriangle(double baseLength, double height){
double area=0.5*baseLength*height;
return area;
}
}
Select the Area.java class from "Project Explorer" view which is in the left handside of eclipse workspace.
Go to File->New->Other... (Or "Ctrl + N")
Select "Web Service" click "Next"
Click "Web service runtime" link and select "WSO2 Web Services Application Server" in the "Web service runtime" list box.
Click "OK".
Click "Finish"
Thats it. Your web service (provided that there aren't any syntax or coding errors) will be published in WSAS server.
When the WSAS server starts it will open the WSAS home page of WSAS server in an external browser. You can click the "List" link under services to see which services are available in the server.
Click on the "Try this service" link infront of the "Area" service to invoke your web service.
So creating a web service is easy. All you have to do is to point to the class which you want to make it a web service.
Saminda Wijeratne, Senior Software Engineer, WSO2, samindaw@wso2.com
Issue with the final step of the deployment
I think this thread is
nike dunks high
Eclipse
Problem at the end of the step 3.
Problem at the end of the step 3.
Hi, Webservices authoring and
jacket from fight club