Tutorial : Building EJB3 Stateless Session Bean and JAX-WS web service In One Class Using RAD 7.5 - Developing EJB3 Client

This series is about building an empty shell application that contains an EJB3 stateless session bean, a JAX-WS web service, and a web application that acts as the EJB and web service clients. I personally built it for performance testing purpose; so I can plug-in "in-doubt" java code to oberve how they handle concurrency in a server environment. But this will serve as a tutorial for those who are interested.

Part 1 : Project Setup
Part 2 : EJB3 and JAX-WS Implementation
Part 3 : Develop EJB3 client
Part 4 : Develop JAX-WS client


Client Web Project Setup

I will create a web project to host servlets that will call the EJB3 Stateless Session Bean and the JAX-WS web service.

From Java EE perspective, Click New -> Dynamic Web Project.


Enter Project Name, ClickFinish.


Once the Project is created, Right Click the project name and Select Properties. Select Java EE Module Dependencies, check TestHarness,jar. This will allow the web project to see interfaces defined in the EJB module.



Create an EJB3 Client

Create a servlet called TestEJBClientServlet.



That's it. The declaration of TestHarnessRemote will be smart enough to use the default JNDI name for the EJB to find a reference to it.

Next, we will create a JAX-WS client.

No comments:

Post a Comment