Book Image

Java EE 5 Development with NetBeans 6

Book Image

Java EE 5 Development with NetBeans 6

Overview of this book

Table of Contents (17 chapters)
Java EE 5 Development with NetBeans 6
Credits
About the Author
About the Reviewers
Preface
Identifying Performance Issues with NetBeans Profiler

Creating a Simple Web Service


In this section, we will develop a web service that performs conversion of units of length. Our web service will have an operation that will convert inches to centimeters, and another operation to do the opposite conversion (centimeters to inches).

In order to create a web service, we need to create a new web application project. In our example, the project name is UnitConversion. We can create the web service by right-clicking on it and selecting New | Web Service.... In the resulting wizard, we need to enter a name and package for our web service.

After clicking Finish, our web service is created, and the web services visual designer window is automatically opened.

To add a web service operation, we simply need to click on the Add Operation... button and fill in the blanks in the resulting window.

Our web service will have two operations; one to convert from inches to centimeters and another one to convert centimeters to inches. Both of these operations will...