Creating a New EJB Control

This topic describes how to create a new EJB control.

To learn about EJB controls, see EJB Control: Using Enterprise Java Beans from a Web Service.

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

Creating a New EJB Control

You can create a new EJB control and add it to your web service by using the Add EJB Control Dialog. The Add EJB Control Dialog can be accessed via the Service menu on the Menu Bar; via the right-button context menu on the service in the Design View; or via the Add Control option menu in the upper right corner of Design View.

To learn more about the Add EJB Control Dialog, see Add EJB Control Dialog.

Deploying the Target EJB

Before an EJB control will function, the EJB it represents must be deployed in WebLogic Server. To learn how to deploy an EJB, please refer to the WebLogic Server documentation.

Making the EJB’s Interfaces Available to WebLogic Workshop

In order for the Add EJB Dialog to discover the EJB's home and remote interfaces, the EJB’s compiled interfaces must be copied to your WebLogic Workshop project.

This is typically accomplished by obtaining a copy of the EJB’s JAR file and placing the copy in the WEB-INF/lib directory of your WebLogic Workshop project.

While the complete EJB JAR file will allow WebLogic Workshop to access the EJB's home and remote interfaces, the only classes actually required are the EJB’s home and remote interface classes and any other classes used externally by the EJB (for example, as method parameters or method return types). The EJB compiler ejbc is capable of producing a client JAR that will serve this purpose. To learn more about EJB client JAR files, please consult the WebLogic Server documentation topic “Packaging EJBs for the WebLogic Server Container”.

Accessing Remote EJBs

You may access remote EJBs using the EJB control. You access remote EJBs by using special syntax in the jndi-name attribute. For example:

jndi://username:password@host:7001/my.resource.jndi.object

Note: In order to access a remote EJB in a different domain via the EJB control you must first perform some advanced security/transaction configuration. Please consult the "Configuring Domains for Inter-Domain Transactions" section of the Managing Transactions topic in the WebLogic Server documentation on e-docs.bea.com.

EJB Control CTRL Files

Some WebLogic Workshop controls may be modified by editing the control's CTRL file. This is not true for the EJB control. The EJB control's CTRL file is created by WebLogic Workshop based on information it obtains directly from the target EJB's code. You should not modify an EJB control's CTRL file.

Related Topics

Controls: Using Resources from a Web Service

Using an EJB Control