on 05-06-2006 5:21 AM
Hi,
I have to access Methods in SessionBean which is living in Another Server .
I Know how to access ejbs which are living in same server but i do't Know how to access remote ejbs.
<b>i am working on NetWeaverDeveloperStudio</b>
Please send me code if possible.
Regards
Guru
Hi Guru,
For "HelloStatelessBean" bean code looks like
final Properties _param = new Properties();
_param.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
_param.put(Context.PROVIDER_URL, "<HOST_NAME>:<MESSAGE_PORT(For my case - 50204)>");
_param.put(Context.SECURITY_PRINCIPAL, "<USER_NAME>");
_param.put(Context.SECURITY_CREDENTIALS, "<USER_PASSWORD>");
final Context initialContext = new InitialContext(_param);
final Object obj = initialContext.lookup("sap.com/Hello/Stateless/HelloStatelessBean");
final HelloHome helloHome = (HelloHome)PortableRemoteObject.narrow(obj, HelloHome.class);
final Hello hello = helloHome.create();
System.out.print(hello.getMessage());
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guruvulu,
You can use the EJBs as similar to any other app server in SAP webAS as well.
Please refer to the following two links, if you are familiar a bit with J2EE and EJB then you will certainly be able to solve your problem with them,
http://java.sun.com/developer/onlineTraining/J2EE/Intro2/session_bean/session.html
http://www.unix.org.ua/orelly/java-ent/ebeans/ch07_01.htm
Hope that helps,
Guru.
P.S. : by the way i am also called guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.