• Entries (RSS)
  • Comments (RSS)

Creating a webservice using RAD 7

Posted by | Posted in RAD | Posted on 27-07-2008

Tagged Under : , , ,

Creating a webservice using RAD 7

Few months back I had posted about webservice Hello World tutorial in Java. At that time I did not find any simple tutorial on how to create a Hello World webservice in Java. Today I will explain how to create a simple webservice in Java using Rational Application Developer version 7(The steps will be almost same for RAD 6 also).

First create a project for our webservice. I just named my project as WebService. Then we need a class for our webservice. We will be exposing this class as our webservice. I have created a class HelloWorld.java with one sayHello method in it. The complete code listing for our HelloWorld.java is given below.

package com.test;
 
public class HelloWorld {
	public String sayHello(String name){
		return "Hello "+name;
	}
}

The next step is to expose this HelloWorld.java as our web service. Right click on the Project and click on New. Click on Other if your ‘Web Services’ folder is not listed. Expand the ‘Web Services’ folder and select Web Service

Click on Next. The Web Service creation wizard opens up. From the next page opened, select HelloWorld.java as our service implementation and the server types.

Click on Next.

Click on Next.

Click on Next.

Click on Finish. You are done with your HelloWorld web service using RAD 7.

Share

Read More

Post a Comment