Creating and deploying Java web services using Eclipse WTP and WSO2 WSAS
Recently WSO2 has worked with Eclipse WTP team to integrate wso2 Web Services Application Server (WSAS) in to Eclipse WTP (Web Tools Platform). This greatly reduces the effort of developing java web services and it will definitely a revolutionary tool for web service developers.
I would like to introduce a few nice features of this user friendly tool, so that anybody can start to use it for java web services development.
In order to use this integrated tool kit, WSO2 web services application server has to be downloaded to your local server. Get the latest WSAS binary distribution from here.
Just unzip it to your local file system. Suppose it is placed at C:\webservices\wso2wsas-2.0.
Now you have to download Eclipse WTP. An Stable WTP build can be downloaded from Eclipse web tools project . I would recommend you to get the wtp-all-in-one package.
Unzip the wtp distribution in to your file system. Suppose its located at C:\eclipsewtp.
Next, you need to add WSO2WSAS plugins to wtp in order to integrate it with the web tools platform. Go to your WSO2WSAS home directory (C:\webservices\wso2wsas-2.0) and run the install.bat under WSO2WSAS_HOME/bin.
It will prompt for selecting one of the two options;
1. WSO2 WSAS Servlet Container Installation
2. WSO2 WSAS Eclipse WTP Plugins Installation
Select 2. It will ask the eclipse WTP Home directory. Enter C:\eclipsewtp
You will see that the installer copying the required plugins to wtp.
Now Start wtp by clicking on eclipse.exe. You should see WSAS startup icon at the tool bar if the WSO2WSAS-Eclipse wtp integration was successful.
Now WTP should be configured to identify the WSAS runtime. Go to Window-->Preferences-->Webservices-->WSAS Preferences and specify WSO2WSAS_HOME directory(C:\webservices\wso2wsas-2.0). You should get the 'WSAS Runtime loaded successfully' message.
Click on 'WSAS server start' icon at the eclipse wtp tool bar.
WSO2WSAS server will be started in a separate command window and "WSO2 Web services application server instance started successfully" message will be displayed.
You can access the WSO2WSAS management console inside the eclipse WTP internal browser.
OK.. Thats all for installing and setting up your java web services platform. Lets write a simple web service and deploy it on WSO2WSAS.
- Create a new dynamic web project (New-->Web-->Dynamic web project)
- Select Target runtime as WSO2WSAS in 'New Server Runtime' (Second step of the new dynamic web project creation wizard)
- Write service implementation class
public class Testservice {
public String echo(String s){
return s;
}
}
- Now right-click on the service class in the package explorer pane and select Web services-->create web service
- Web service creation wizard will be displayed.
- Don't forget to change web service runtime to WSO2WSAS in the first step of the wizard.
- Click Finish
If you access WSO2WSAS management console through WTP internal browser, you can see your web service is deployed there.
You should realize how WSO2WSAS-Eclipse WTP integration reduce the java web service development effort and provide a user friendly IDE for JAVA web service developers.
You can find more information on WSO2WSAS at WSAS home page
I would like to introduce a few nice features of this user friendly tool, so that anybody can start to use it for java web services development.
In order to use this integrated tool kit, WSO2 web services application server has to be downloaded to your local server. Get the latest WSAS binary distribution from here.
Just unzip it to your local file system. Suppose it is placed at C:\webservices\wso2wsas-2.0.
Now you have to download Eclipse WTP. An Stable WTP build can be downloaded from Eclipse web tools project . I would recommend you to get the wtp-all-in-one package.
Unzip the wtp distribution in to your file system. Suppose its located at C:\eclipsewtp.
Next, you need to add WSO2WSAS plugins to wtp in order to integrate it with the web tools platform. Go to your WSO2WSAS home directory (C:\webservices\wso2wsas-2.0) and run the install.bat under WSO2WSAS_HOME/bin.
It will prompt for selecting one of the two options;
1. WSO2 WSAS Servlet Container Installation
2. WSO2 WSAS Eclipse WTP Plugins Installation
Select 2. It will ask the eclipse WTP Home directory. Enter C:\eclipsewtp
You will see that the installer copying the required plugins to wtp.
Now Start wtp by clicking on eclipse.exe. You should see WSAS startup icon at the tool bar if the WSO2WSAS-Eclipse wtp integration was successful.
Now WTP should be configured to identify the WSAS runtime. Go to Window-->Preferences-->Webservices-->WSAS Preferences and specify WSO2WSAS_HOME directory(C:\webservices\wso2wsas-2.0). You should get the 'WSAS Runtime loaded successfully' message.
Click on 'WSAS server start' icon at the eclipse wtp tool bar.
WSO2WSAS server will be started in a separate command window and "WSO2 Web services application server instance started successfully" message will be displayed.
You can access the WSO2WSAS management console inside the eclipse WTP internal browser.
OK.. Thats all for installing and setting up your java web services platform. Lets write a simple web service and deploy it on WSO2WSAS.
- Create a new dynamic web project (New-->Web-->Dynamic web project)
- Select Target runtime as WSO2WSAS in 'New Server Runtime' (Second step of the new dynamic web project creation wizard)
- Write service implementation class
public class Testservice {
public String echo(String s){
return s;
}
}
- Now right-click on the service class in the package explorer pane and select Web services-->create web service
- Web service creation wizard will be displayed.
- Don't forget to change web service runtime to WSO2WSAS in the first step of the wizard.
- Click Finish
If you access WSO2WSAS management console through WTP internal browser, you can see your web service is deployed there.
You should realize how WSO2WSAS-Eclipse WTP integration reduce the java web service development effort and provide a user friendly IDE for JAVA web service developers.
You can find more information on WSO2WSAS at WSAS home page
Comments
Why is WSO2WSAS distribution free and how will it benefit the company.
PS : Are you a Dan Brown fan
I'm really sorry for the very late reply. It was totally due to project works and I couldn't find time to keep in touch with my blog.
WSO2 is an open source software company. We develop SOA middleware and anybody can download and use them without paying a cent. You can get more information about our company at www.wso2.com
WSO2 WSAS is an application server for hosting and managing web services. It is one of our core products and you can download it free from our developer portal www.wso2.org
Web service application server can be used to develop and deploy your java web services in effective and efficient manner.
Feel free to ask any questions through our mailing lists. Let me know if you need any assistance on using WSO2 WSAS.
For your final quiz, Yes,, I'm a huge fan of Dan Brown :)