Sunday, November 16, 2008

installing and using axis2 plugin

1) Download axis2 plugin from

http://ws.apache.org/axis2/tools/index.html

2) Extract plugin in eclipse/plugins directory

3) In eclipse IDE go to menu windows -> preferences
click on option web services -> Axis2 Preferences and specify location of folder where axis2 is installed.

4) To use axis2 plugin, goto project "properties" pane, and select "Project Facets" and select "Axis2 Web Services"

Now your project is ready to create a webservice using Java to WSDL style or from WSDL to Java.

To create a WSDL from java class, right click on class name and select "Web Services" -> "Create Web Service"

Other options options is to create the web service using File -> "New" --> "Other" -> Axis2 Wizards -> Axis2 Code Generator

InvocationTargetException in Eclipse Axis2 plugin

When generating WSDL code from a java class using Eclipse/Axis2 plugin version 1.4.1 an exception is thrown( java.lang.reflect.InvocationTargetException).

This version of plugin is missing 2 jar files ( backport-util-concurrent-3.1.jar, geronimo-stax-api_1.0_spec-1.0.1.jar) in lib directory. Here are the steps to get around this problem. The jar files could be copied from lib directory under Axis2 distribution.

1) Copy jar files to eclipse/plugins/Axis2_Codegen_Wizard_1.3.0/lib directory
2) Add these jar entries to eclipse/plugins/Axis2_Codegen_Wizard_1.3.0/plugin.xml
3) Restart eclipse IDE using -clean option. (modify eclipse.ini file)

More plugin problems can be dubugged using a cool technique mentioned in blog post
http://blogiterox.wordpress.com/2008/10/24/exploring-apache-axis2-and-eclipse-plug-in-development/