Thursday, May 6, 2010

Developing Web Service using Axis and Netbeans 6.5

1.   Create a java project in netbeans.
2.   Add java file to the project which contains the implementation code.
3.   Download the plugin for axis if not installed…..
Tools->plugins->Available pugins
4.   Add Axis library to the library
5.   Right Click the project->new->axis2 service from java. It would create webservice.
6.   Create a webservice client Reference. Project->New->Webservice Client. Give the refrence of the web service in the project.
7.   Build the project
8.   copy the webserrvice.aar file from build/WEB_INF/service directory to axis/repository/services
9.   add the service name(aar filename) to the service.list file in axis/repository/services.
10.   run the axis server. Axis/bin/axis2server.bat
11.  Check the list from browser. http://localhost:port/axis2/services. Here you can see your webservice listed.

Creating a client which consumes the service
1.   Create a client java file in separate package(Not in the package where the webservice java class is placed).Dont forget to create main method !!!!!!!
2.  In the main method right click webservice client resource->call client resource
3.   select the webservice from the list.
4.   run the client file and you are done!!!!!!!!