Implementing Web Services within an EJB Module


To implement a web service in an EJB Module, you will use a similar web service wizard described for the web application. Most of the artifacts that are created and the deployment descriptor entries that are added for the module are similar to those in a web application. You will follow the same procedure for adding SOAP message handlers and configuring them in web services.

One significant difference is the implementation bean of a web service in an EJB module. JSR 109 requires that web services be implemented in the EJB module as stateless session beans. Thus, the implementation of the web service operations in an EJB module is contained in the session bean class. The module's deployment descriptor will have a stateless session bean entry, but this will declare an endpoint interface instead of a local or remote interface. Also, a web service in an EJB module does not have a home interface.

Once you have created a web service within an EJB module, you will see the Web service logical node in the Projects window (shown in Figure 12-11). The source code you will manipulate is the stateless session bean implementation class. The developer experience is similar to the development of a web service with a web application.

Figure 12-11. Web service within an EJB Module


In the Source Packages node, you can see the service bean class and the SEI and the service XML config file.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net