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.
Did you like this? If so, please about it, and subscribe to the blog RSS feed.If you enjoyed this post, make sure you subscribe to my RSS feed!
Related Posts:
3 Responses to “Creating a webservice using RAD 7”
- 1 Pingback on Sep 15th, 2008 at 7:27 pm































how to execute this code
Good question. If you just need to test the webservice you created, you can use the web services explorer. To use the web services explorer, navigate to your Web Content/wsdl folder. Right click on the wsdl files generated and select Web Services -> Test with Web Services explorer. This would open the web services explorer in a new web browser. Click on your service find out the method you want to test. In our case it will be sayHello. Click on the sayHello method and from the right pane enter provide an input to the method and click on Go. You will be able to see the result of your hello world web service output.
If you need to test the web service using your own client, follow the steps in http://www.albeesonline.com/blog/2008/01/29/generating-a-web-service-proxy-client/ . Once you have generated the client use the proxy classes to call your web service.