Hello world webservice Step by step explanations

Hello world webservice Step by step explanations

Step 1: Create a dynamic web project “HelloService” like below,

hello webserivce



Step 2: Create a file named “Hello.java” under src of the above HelloService dynamic project,

public class Hello {
	public String HelloWorld(String input){
		return "Hello"+input;


Step 3: Now right click on the project(Hello Service) and create the “Web service” like below,

web service for helloservice


Hello Webservice has been created successfully, now we will create the client and call the above created service.

Right click on the HelloService and run as server,

running helloservice


our hello service


helloservice url

Step 4: Create the “HelloClient” dynamic web project.

Step 5: Right click on the above created project and create the “Web service client” like below,

web service client


Step 6: Create a HelloTest java file under src of HelloClient dynamic project and paste the below code,

import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import org.apache.ws.axis2.HelloStub;
import org.apache.ws.axis2.HelloStub.HelloWorld;
public class HelloTest {
	public static void main(String[] args) throws RemoteException{
		HelloStub hsub = new HelloStub();
		HelloWorld hw = new HelloWorld();
		String print = hsub.helloWorld(hw).get_return();

¬†Step 7: Run the above program as “Java application”.



 Download the source codes:






Thanks for reading this post…………!!!

996 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.