Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

php calling EJB

 
mahesh narayan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a scenario where

a) there is a php file in IBM http server
b) there is an EJB object in websphere app server. EJB in turn interacts with the DAO -> DB and gets data.

the requirement is tht the php should pass a value to the EJB. EJB interacts with dao and db and gets the data. This data needs to be send back to the php file.

Can someone provide me tips on how to acheive this.

Earlier i tried to call a servlet which in turn talks with the EJB to get the data. But i dont know how to get the data back from the servlet to the php file(on http server)

Any help would be appreciable

rgds
Mahesh
 
Shibu Raj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mahesh,
It looks like a perfect secnario to use the Web Service Support provided by J2EE. PHP also have some excellent support for consuming a web service.

In your case, if you are planning to write new EJB's then provide them with web service endpoint as well, which can be called by your PHP application.

Suppose if the EJB is already written and being used by some other application, Have a new wrapper EJB which uses the existing EJB's to get the work done and expose this new wrapper EJB as a web service. Please note that to expose as a web service we need to have the wrapper as a stateless session bean.

Once this is deployed you can have your PHP application consume this web service to interact with each other.

By having this kind of system architecture will make your PHP and EJB applications loosely coupled. Since Web service is session bean, all the benifits of session bean will also be available for this case.

Thanks
Shibu Raj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic