So far, you have seen how to implement a web service and arrange for it to be hosted by a servlet in a web container. J2EE 1.4 extends this model by allowing you to implement web services as stateless session beans in the EJB container or, if you want to view it another way, to advertise the remote interface of an existing stateless session bean as a web service, provided that the interface methods meets the requirements of a JAX-RPC service endpoint interface.
Session beans typically have a combination of the following:
A remote interface that contains the service methods that remote
clients can invoke. This interface is required to extend
A local interface that contains the methods available to clients that
reside with the session bean. This may be the same set of methods as
those in the remote interface, but this is not required. The local
A home interface that remote clients use to manage their view of the
lifecycle of the session bean, including obtaining an instance of it
and releasing it when it is no longer required. The home interface
javax.ejb.EJBHome and is required to
exist if the session bean provides a remote interface.
A local home interface, which is the equivalent of the home interface
for clients that are local to the bean and extends
javax.ejb.EJBLocalHome. The local home interface is required only if the bean provides ...