How Do I: Use an Existing Enterprise Java Bean?
WebLogic Workshop provides the EJB control to enable convenient access to an existing Enterprise Java Bean (EJB) from web services. To use an EJB, the client interfaces must be present in a JAR file in the WEB-INF\lib directory of the appropriate WebLogic Workshop project.
To Use an Existing Enterprise Java Bean
In WebLogic Workshop, open the project that will use the EJB.
If the WEB-INF\lib folder exists in the project, skip to step 5. If not, proceed to step 3.
In the Project tree, right-click the WEB-INF folder and select New Folder.
In the Enter a new folder name field, type lib, then click OK.
Copy the EJB JAR file from the to the WEB-INF\lib folder.
Once the EJB is included in your project, you can create a control to access to the EJB.
In WebLogic Workshop, open a web service that will use the EJB.
In Design View, from the Add Control drop-down list, select Add EJB Control. The Add EJB dialog appears.
Enter a variable name that your web service will use to reference the control member. It is customary for this name to start with an lower-case character. The name you enter must be a valid Java identifier.
Select Create a new EJB control to use with this service.
In the New CTRL name box, enter a name for the CTRL file. It is customary for this name to start with an upper-case character. The name you enter must be a valid Java identifier.
In the jndi-name field, type the Java Naming and Directory Interface (JNDI) name for your EJB, or click Browse to select one. Once you have selected an EJB by JNDI name, the home and bean interface text boxes should contain the names of the EJB's interfaces.
Click Create.
A CTRL file is created in the same directory as the web service to which it is being added, and a reference to that control is added to your web service. This control can now be used to access methods in the EJB. This CTRL file can also be used by other web services.