[Download] | [Documentation Home] | [Release Note]
WSO2 Web Services Application Server (WSAS) now supplies pluggable components in the form of Eclipse WTP plugins which enable it to be integrated with the popular IDE Eclipse. This guide is meant to demonstrate the use of the newly introduced WSAS Web Services tools in tandem with the Eclipse Web Tools Platform Project using WTP 2.0 drivers. The guide shows how to create a simple Web service and client based Web service operations using the linked Dynamic Web Projects of WTP.
Note : This feature is a new addition to WSAS v2.0. Also,
since Eclipse WTP requires Java 2 SDK 5.0 or higher, WSAS Eclipse WTP Plugins
will require Java 2 SDK 5.0 or higher.
JDK 1.5 Eclipse WTP 2.0 requires j2sdk 5.0 or higher
Go to WSAS_HOME/bin and run install.bat script if in the Windows environment, or install.sh in a Unix based environment.
You will be asked for the installation mode.
Please select your installation mode : [1/2]
1) WSO2 WSAS Servlet Container Installation
2) WSO2 WSAS Eclipse WTP Plugins Installation
: 2
Selection: WSO2 WSAS Eclipse WTP Plugins Installation
Starting WSAS Eclipse WTP Plugin installation...
Please enter Eclipse WTP Home :
If you did not close the running instance of Eclipse WTP, you will be shown this message.
Please shutdown the Eclipse instance [c:\eclipse] , If Already Running ...
Copying WSAS Eclipse WTP Plugins C:\eclipse\plugins
OK
WSO2 WSAS Eclipse WTP Plugin installation was successful.
Please restart Eclipse WTP Instance..
Now we point Eclipse WTP to the downloaded WSAS Runtime. Open Window -> Preferences -> Web Services -> WSAS Preferences
Set the WSAS HOME variable to point to the local WSAS location.
Also on the WSAS Preferences page, we can set the default setting for the Web services creation codegen options, Web services client codegen options and service archive options
After setting the preferences, we can start the WSAS from the WSAS Main menu or from the WSAS Tool bar.
After starting WSAS, it will automatically display the console and the WTP internal browser with the WSAS HOME Page.
You can shutdown the eclipse instance either from the menu or the toolbar.
Now we create a project with the support of WSAS features. Open File -> New -> Other... -> Web -> Dynamic Web Project
Select the name of the Project as the Dynamic Web project name (you can specify any name you prefer).
Click on the New Target Runtime button and select the WSO2 WSAS 2.0 target runtime.
Then click Finish. This will add the target runtime and the configurations of the default WSAS settings.
Click Next.
Then on the facet creation page, select the WSAS Web Services Facets , Core and Extentions.
Click Next. Then accept the default configuration settings on the Configure Web Modules Page.
Click Finish and it will create the Dynamic Web Project with the support of WSAS Web Services functionalities.
package test; import java.util.Calendar; import java.util.GregorianCalendar; public class LocalTimeBot { public String getLocalTime() { Calendar cal = new GregorianCalendar(); return cal.getTime().toString(); } }
Create a LocalTimeBot class inside the src under the given package test. Then compile and build the project.
Click Finish.
package test; import java.rmi.RemoteException; import org.apache.axis2.AxisFault; public class LocalTimeBotClient { public static void main(String[] args) { LocalTimeBotStub stub; try { stub = new LocalTimeBotStub(); LocalTimeBotStub.GetLocalTimeResponse res = stub.getLocalTime(); System.out.println("Local Time :" + res.get_return()); } catch (AxisFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } } }
* Increase the default memory usage in eclipse.ini file. Normally Eclipse WTP comes with -Xms40m -Xms256m Normally with the servers inside WTP would require -Xms256m -Xms512m to work efficiently.
* In some Linux distros the Eclipse Internal Browser will not function correctly. If that becomes an issue the users need to Enable SSL on Mozilla browser.
Steps Enable SSL on mozilla
export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZILLA_FIVE_HOME
The open mozilla firefox and type about:config on the address bar and set the below settings
1. enable security.enable_ssl2 to true
2. enable security.enable_ssl3 to true
3. enable security.ssl3.rsa_rc4_40_md5 to true
Restart firefox and restart eclipse, the internal browser will work properly.
© 2007 WSO2 Inc.