How to call a session bean from an Java Application
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, February 27, 2002 11:44 PM

I need to call a session bean running on websphere3.5 from java application running on different machine or the same machine were Websphere is installed.



Is it possible to pass data from the application to session bean and also recieve data from session bean.


Reply fast as this is a serious problem.


regards


Sunil Kumar

Re: How to call a session bean from an Java Application

Posted By:   Ashish_Sinha  
Posted On:   Monday, March 4, 2002 12:05 AM

Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://127.0.0.1:7001");
InitialContext m_ctxt = new InitialContext(prop);

Object obj = m_ctxt.lookup("om2.admin.tabControl.TableControlHome");
TableControlHome home = (TableControlHome)
PortableRemoteObject.narrow(obj,om2.admin.tabControl.TableControlHome.class);

TableControlRemote rem = home.create();







That is how I get the remote stub in Weblogic from an independent client application. Once u hav remote stub , u can call any remote method, pass or receive objects.

Re: How to call a session bean from an Java Application

Posted By:   Bozidar_Dangubic  
Posted On:   Friday, March 1, 2002 06:20 AM

yes, I am sure it is a serious problem :-) but an easy problem. any java application can access session beans so long as there is a network connection to the application server hosting the session bean, you have remote and home interface classes in the application's classpath, you have application server's client jar in the application's classpath and have appropriate credentials to connect to the application server. that is it.
About | Sitemap | Contact