ejb可以实现远程调用吗?怎样实现? 和webservice的区别? Ejb是可以实现远程调用的,至于怎么调用,如果你真要知道,恐怕只能自己仔细的学学了,因为涉及很多的细节。. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果你使用JBuilder,eclipse的话可以自动生成EJB测试类,上面就会有生成代码,一般是有以下几步,建立jndi上下文,查询出HOME接口,使用Home的create新建类就可以使用了。简单的很,EJB与webservice都是远程调用服务。但webservice是使用HTTP协议来进行传输,可以使用SOAP来进行调用,在.NET,JAVA,DEPHI都可以找到进行SOAP调用的接口。EJB使用专门的协议来进行数据传输。WEBservice的效率没有EJB高。 但是,客户端jndi调用ejb包时候,好像没有制定服务器地址,只是指定了包名字?它在哪里绑定url ,就和soap一样绑定wsdl到url呢?webservice效率没有ejb高?消耗在哪里呢? 就像initial.lookup("java:comp/env/ejb/SimpleCart"); 而soap是可以绑定如:bind("http://192.168.22.22/aa.wsdl", test.Class)ejb在哪里绑定呢? 咱用EJB搞东西,其实都没用用到其分布式的特点,可悲啊。也许问题很简单。帮你顶。 给你一个例子,是weblogic上的用的 String url = "t3://YOUIP:7001"; String user = null; String password = ""; Properties properties = null; properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); properties.put(Context.PROVIDER_URL, url); if (user != null) { properties.put(Context.SECURITY_PRINCIPAL, user); properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password); } return new InitialContext(properties) ;在用这个来lookup就行了 LinkedQueue 的说明手册 谁有? axis2 和jdk的问题 Quartz异常怎么处理 关于hibernate 的Session js页面像action传值的问题 子页面修改数据后,父页面刷新问题 java 字符串乱码问题!!! 使用本地EJB有什么优点? 请问JB7/WEBLOGIC7写实体EJB时,一定要正版WEBLOGIC吗? 求救:ClassPath的设置 有没有会话Bean通过本地接口调用实体bean的例子? global-forwards的问题
webservice效率没有ejb高?消耗在哪里呢?
而soap是可以绑定如:bind("http://192.168.22.22/aa.wsdl", test.Class)ejb在哪里绑定呢?
也许问题很简单。帮你顶。
String user = null;
String password = "";
Properties properties = null; properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null)
{
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties) ;
在用这个来lookup就行了