Creating a Web Service with a Stateless Session Bean Back End
The process of creating a Web Service from a Stateless Session Bean is pretty straightforward. Implement the bean and create its JAR file. Listing 30.7 contains the code for the DoctorInfoBean. Running the EJBGen tool against it will create the EJB support classes and the EJB JAR file.
Listing 30.7. Stateless Session Bean Using EJBGen
package com.wls8unleashed.webservices; // This is an EJBGen-annotated class import java.rmi.RemoteException; import java.util.*; import javax.ejb.*; import javax.naming.*; import javax.rmi.PortableRemoteObject; /** * * @ejbgen:session * ejb-name = DoctorInfoEJB * default-transaction = Required * * @ejbgen:jndi-name * remote = com.wls8unleashed.webservices.DoctorInfoHome ... |
Get BEA WebLogic Server™ 8.1 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.