In this article i am going to explain step by step how to use
Netbeans IDE v5.5 to create a simple Web Service replying with a Hello String + the name parameter passed to it along with 3 Web Service Clients invoking it: A Web Client (JSP Page), a Desktop Client (JFrame) and a Mobile Client (MIDLET). The following projects use JAX-WS and the latest Web Services technologies.
1. Launch NetBeans IDE and Create a new Project from type "Web Application".
We are going to call our project "sayHelloWS" and choose Tomcat v5.5.17 as our deployment server. Be careful to uncheck the Set Source Level to 1.4 option for compatibility reasons while working with Web Services.

2. From the context menu of our new just created web project select to create a new "Web Service".

3.In the "New Web Service" Dialog Box, type the service name "sayHelloWS" and specify a Java package that will contain the service source files. Let us call it for instance com.ws.hello

4. After Pressing the "Finish" button in the later screen, NetBeans will create for you all the source files and configurations needed. Notice the annotation "@WebService()" just above the web service class.
We need now to add a simple function to our web service to let it do an action. Right click on the service name in the "Web Services" folder from the Projects Explorer then choose "Add Operation".

5. We are going to call the method "sayHello" with return type "String" and with one only parameter called "name" from type "String" as well.

6. In the figure below you'll notice that the new method has been added - also with the annotations @WebMethod and @WebParam - to our web service class. Just modify the return line to return a meaningful string such as the word "Hello" concatenated with the name passed to the method. In fact this is all what our web service will be able to do.

7. Run & Deploy the web project. Then right click on the web service "sayHelloWS" then choose "Test Web Service".

8. The default browser should launch then on the web services page of your web project and you are supposed to see something like that.

In the above screen you'll notice that our "sayHelloWS" web service is listed with "ACTIVE" status along with the service information such as the address,WSDL document,port and implementation class.
If you reached this point then you have successfully created and deployed your first web service and you are ready to build the 3 clients that invoke this great web service!
Tune in till next episode..