Develop Java EE Web Services with Eclipse, AXIS2 and Tomcat
We will develop a Java based SOA web service using the Bottom Up Approach (Writing business logic code first and then writing the WSDL and other XML's)
What is Required:
1) Eclipse for Java EE Developers
2) Apache Axis2
3) Tomcat 5+ Server
4) 20-30 minutes
Download Eclipse from the official Eclipse website.
Make sure you download the Eclipse IDE for Java EE Developers version
Download Axis2 which is the most popular tool for developing web services.
Make sure you download Axis2 and not Axis
Download Tomcat server V5.5.
You can even use V6.0 for this demo.
Go to Eclipse home directory and run Eclipse
While starting, eclipse will ask for setting the Workspace folder.
Create a new Java Project from Project Explorer
Specify the project name
Create a new class by right clicking the “src” folder in Project Explorer
Enter package and class name
Write a method to be invoked inside the Test class
Open the server view
Add a new Server where the web service will be deployed
Select the location where tomcat is installed/unzipped
Specify Apache Axis2 location to help eclipse build the web service
Creating the web service and client
Move the slider for Web service as well as client to “Test”
Specify that you want to use Axis2 and not Axis
Eclipse will do some processing. Wait and watch.....
If everything goes fine then the client web page is displayed to you.
Invoke the test method which we wrote...
We get the sysout output in server logs
Have you noticed the extra two projects being created by Eclipse.
Happy Web services coding...
No comments:
Post a Comment