EJB Control: Using Enterprise Java Beans from a Web Service

Enterprise Java Beans (EJBs) are Java software components of enterprise applications. The Java 2 Enterprise Edition (J2EE) Specification defines the types and capabilities of EJBs as well as the environment (or container) in which EJBs are deployed and execute. From a software developer’s point of view, there are two aspects to EJBs: development and deployment of EJBs; and use of EJBs from client software. WebLogic Workshop provides the EJB control as a simplified way to act as a client of an existing EJB from within a web service.

Note: WebLogic Workshop is not intended for development or deployment of new EJBs; to learn how to develop and deploy EJBs please consult the WebLogic Server documentation or a book on J2EE.

To access the capabilities of an EJB without the EJB control, you would have to perform several preparatory operations. You would look up the EJB in the JNDI registry, obtain the EJBs home interface, obtain an EJB instance, and then finally invoke methods on the EJBs remote interface to do real work.

The EJB control relieves you of all of the preparatory work. Once the EJB control has been created, a web service may use the control to access the EJB's “business methods” directly. The EJB control manages communication with the EJB for you, including all JNDI lookup, interface discovery and EJB instance creation and management.

To learn about WebLogic Workshop controls, see Controls: Using Resources from a Web Service.

# Topics Included in this Section

Overview: Enterprise Java Beans (EJBs)

Describes Enterprise Java Beans in general.

Creating a New EJB Control

Describes how to create and configure an EJB control.

Using an EJB Control

Describes how to use an existing EJB control from within a web service.

# WebLogic Workshop is Not Intended for EJB Development

WebLogic Workshop is specifically not intended to help you develop and deploy EJBs. In fact, if you store EJB source code in your WebLogic Workshop project you may experience compilation errors because WebLogic Server will attempt to compile source code it finds there. This will conflict with the deployed EJB.

The WebLogic Workshop EJB control is intended to make it easy for you to use an existing, deployed EJB from within a web service.

Related Topics

Controls: Using Resources from a Web Service