Creating a Web Service class
In this section, we take a look at the Java Web Service (JWS) file, which is simply a Java class annotated with the @WebService
annotation (http://java.sun.com/javase/6/docs/api/javax/jws/WebService.html), for implementing a JAX-WS Web Service. JSR 181: Web Services Metadata for the Java Platform defines the standard annotations that can be used in a Java Web Service. The javax.jws.WebService
annotation specifies that a class implements a web service. All the attributes of the @WebService
annotation are optional. First, create a Java class by selecting Java Class in the New Gallery. In the Create Java Class window, specify the class name as EJB3WSImpl
. A Web Service class gets added to the EJB 3.0 project. The Entity class may also be made a web service by annotating it with the @WebService
annotation. However, creating a separate Web Service class provides the advantage of de-coupling the Entity bean from the web service; if modifications are required to the...