如何从 PHP 调用 EJB 会话 bean?
有没有办法从 PHP 调用 EJB 会话 bean?有什么具体的功能可以做到这一点吗?
Is there any way to call an EJB session bean from PHP? Are there any specific functions to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
并不真地。如果您可以进行 CORBA 调用,大多数容器都支持 CORBA 作为与远程 EJB 通信的协议,但我不推荐它。
您最好将 EJB 会话 Bean 调用公开为 SOAP Web 服务,或者简单地使用 Servlet 将其封装起来,并将其作为临时 Web 服务进行调用。
现在,如果您在 Java EE 服务器中运行 PHP(我相信 Resin 可以运行 PHP),那么您也许能够调用可以调用 EJB 方法的 Java 调用。
但是,坦率地说,Web 服务或临时 Web 外观可能是您通往成功的最佳且最快的途径(假设您被允许编写它们)。
Not really. If you can make CORBA calls, most container support CORBA as a protocol to talk to a remote EJB, but I wouldn't recommend it.
You'd have better luck exposing the EJB Session Bean call as a SOAP Web Service, or simply facade it with a Servlet and invoke that as an ad hoc web service.
Now, if you're running PHP within a Java EE server (Resin I believe can run PHP), then you might be able to invoke a Java call that can call an EJB Method.
But, frankly, the web service or ad hoc web facade is likely your best, and quickest path to success, assuming you're allowed to write them.
有一些库可以实现 Java/Php 桥接,例如 PHP/Java Bridge。
因此,如果您使用的是 IBM WebSphere(源):
There are some libraries that do Java/Php bridge implementation, such as PHP/Java Bridge.
So if you were using IBM WebSphere (source):