TraderEJBClient.jws Sample

A web service that demonstrates use of the EJB control TraderEJBControl.ctrl, which represents the TraderEJB Stateless Session Bean and exposes its business interface to web services.

# Concepts Demonstrated by this Sample

- Use of an EJB control

- Use of Conversations

# Location of Sample Files

This sample is located in the ejbControl folder of the samples WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic700\samples\workshop\applications\samples\ejbControl\AccountEJBClient.jws

# How to Run the Sample

To run this web service:

1. Start WebLogic Server in the appropriate domain.

   - On Microsoft Windows systems, from the Start menu navigate to:

   BEA WebLogic Platform 7.0->WebLogic Workshop->WebLogic Workshop Examples->Start Examples Server.

   - On Linux or Solaris systems, run:

   BEA_HOME/weblogic700/samples/workshop/startWebLogic.sh

2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/ejbControl/AccountEJBClient.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine, you may click here to run the sample.

3. Navigate to the Test Form tab of Test View, if necessary.

4. Enter values for tickerSymbol and numberOfShares in for either the buy or sell method and invoke the method.

5. Click on the Message Log title to return to the methods.

6. TraderEJB, the EJB that is represented by TraderEJBControl, is a Stateless Session Bean and therefore does not store any information. Its sole purpose is to qualify transacations: it limits all transactions to 500 shares.

7. Examine the TraderEJBClient.jws and TraderEJBControl.ctrl files to explore the relationship between the control and its client. The TraderEJBControl.ctrl file was created using the Add EJB Control dialog.

8. Select log entries in the Message Log to see the message traffic involved in each interaction.

Related Topics

AccountEJBClient.jws Sample

Controls: Using Resources from a Web Service

EJB Control: Using Enterprise Java Beans from a Web Service

Test View