Web Service - Create Your First Web Service

Here we will see how to create a web service using Eclipse. Eclipse provides support for creating Web Service using three API's:

  • Axis-1
  • Axis-2
  • Apache CFX
Eclipse automatically includes all necessary jar files and configurations to create Web Services with the above Java API's. Let's see how to create our first Java Web Service with eclipse using Apache Axis-1 API.

Step One: Create a New Project
Go to File-> New-> Other-> Web-> Dynamic Web Project
Create your first web project by giving it a name.




Now click Finish Button.

Step Two: Add a New Java Class to your Project
Right click on src-> create a new package-> right click on the package-> create a new class->
For example name it CalService.



Step Three: Add method to your Java Class



Step Three: Create your Web Service using the Class

Right click on the class CalService-> New-> Other-> Web Service-> Web Service->




  1. Type: Two type Top Down and Bottom Up.
  2. Implementation: Give the service implementation name of web service.
  3. Server Runtime: Select Server
  4. Web Service Runtime: Select one
  5. Select Service Project
Here you're all done. Now go to Webcontent of your project you will find the wsdl file there. 


Open the wsdl file and at the bottom side you'll find the EndPointURL of your web service to access it.









Comments