Creating an EJB-based web service using JAX-WS

In this recipe, we will demonstrate how to create a JAX-WS application based on a stateless session EJB. There are several variations on how this can be done, however, they all use a class as the web service and embed other session EJBs to provide the web service's functionality. Stateless and singleton session beans can be used as endpoints. As of EJB 3.1, stateful session beans can also be used for endpoints.

Getting ready

The two fundamental steps involved in the creation of a JAX-WS web service include:

  1. Creating an EJB which provides the application's functionality
  2. Creating a Web Service (JAX-WS) which utilizes the EJB

The creation of the EJB is detailed in earlier chapters, particularly Chapter ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.