Java Reference
In-Depth Information
Now all we need to do is to replace the generated body of the methods in the class
with the "real" bodies, deploy our application, and our web service will be good to
go. In our case, all we need to do is divide the inches by 2.54 to convert from inches
to centimeters, and multiply the centimeters by 2.54 to convert them to inches.
Notice that the generated web service class is a Plain Old Java Object ( POJO )
using some annotations. The @WebService annotation at the class level is used to
indicate that our class is a web service. Each method in the class that is exposed
as a web service operation must be annotated with the @WebMethod annotation.
The operationName attribute of this annotation is used to map the method to an
operation defined in the web service's WSDL.
When developing web services with NetBeans, we don't need to worry
about creating a WSDL file; one will automatically be generated upon
deployment of our application.
Additionally, each parameter in each method is decorated with the @WebParam
annotation, which maps the method's parameter to a type definition in the service's
WSDL schema.
The WSDL and it's schema can be generated by right-clicking on the web
service and selecting Generate and Copy WSDL...
Once we have replaced the method bodies with the actual required functionality,
we are ready to deploy our web service, which can be done by right-clicking on our
project and selecting Undeploy and Deploy .
 
Search WWH ::




Custom Search