I am new to EJB world,reading EJB in Action book to get the basic concepts. I understood that EJB is useful for writing reusable business compoents(pure business project) in any orgnization.To implement this i tried a HelloWorld example with below approach
1. Installed RAD with WAS7 for writing a EJB component in my local system
2.Installed JDK in my local system
3. BY pointing to WAS7 JDK, written below code and deployed to WAS7 successfully
Now i want to write a client application by pointing to Installed JDK, am i need to genrate any stubs for this?If so how can i genrate the stubs?
In webservices the interaction will be done in the form of XML's,so how the interaction will done from client to SessionBean in EJB?
posted 2 years ago
You are right with web service usually we have SOAP(xml) over HTTP, for EJBs it will simply be RMI the data being serialized.
To call your EJB the way you do it depends on the type of client.
But basically the idea is to do JNDI lookup to get a local proxy of your remote EJB.
In a server you can use dependency injection @Resource, outside a server you'll have to code manually the JNDI lookup.