Question

I have no knowledge of EJB. I am asssuming its an alternative to get data from somewhere as we do in consuming webservices. For my new project we will be using EJB for getting data. These services will be developed by some other team.

I was hoping if someone can guide me to links on how to use EJB services in our java code. What all things are needed. Like for consuming webservice, we have a wsdl, generate client, create stub object and call our method. Similar kind of steps for consuming ejb servies.

Was it helpful?

Solution

For EJBs you don't need to create a client. Just "inject" it inside you code.

If you want to call it from EE code (e.g. other EJB or a servlet) just use @EJB to define the EJB injection.

If you want to use it in not EE code (e.g. Struts action) you use JNDI to lookup for the EJB.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top