Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB & Webservice

 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Whats the main difference b/w a EJB & Webservice ..
In which case a webservice is to be used & in which case a ejb shd be used..
May be it's a foolish question to ask here.

Srini
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB is based on RMI-IIOP protocol whereas Web services is based on SOAP protocol over HTTP(or any other).

WebServices is used for intergrating hetergenous platforms. WebServices makes it possible to expose your API's to your business partners where the client application could be running in a different platform (.NET for exampel) than the server. You might have guessed that WebServices has a performance overhead compared to native implementations.

It is possible to expose EJB 2.1 as a Webservice endpoint.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebServices could also be used when you cannot predict which platforms the clients will run.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice .. Thanks Pradeep..
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic