This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes EJB vs Web Services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "EJB vs Web Services" Watch "EJB vs Web Services" New topic
Author

EJB vs Web Services

kris reddy
Greenhorn

Joined: Nov 07, 2000
Posts: 19
I understand that when components are distributed and when they need to talk to each other, EJB is employed (Considering a web scenario). Do web services act as an alternative to EJB ? Any input on this is appreciated.
Thanx


Kris Lee
Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
One major disadvantage of using EJB technology for distributed components is that the client typically must also be Java based. Of course you could use CORBA and IIOP to accomplish this, but that introduces a significant layer of complexity unless you are already using CORBA. Another disadvantage of EJBs is that they typically aren't firewall friendly, meaning that it is difficult to invoke EJBs behind firewalls. That isn't to say that EJBs aren't a good solution for certain applications. And, in fact EJBs and web services can be used together.
What web services enable is a platform independent, language independent technology for allowing two applications to interact with each other using XML as the representation format. Because SOAP (the represenation and invocation) standard for web services typically supports HTTP as a transport, the firewall issue isn't as much of a concern because most firewalls open port 80 (or 8080) for HTTP traffic.
Have a look at the following article from XML Journal written by a colleague. It helps show examples of how web services and J2EE can work together.
http://www.sys-con.com/xml/articleprint.cfm?id=649
Best regards,
Mark
Originally posted by kris reddy:
I understand that when components are distributed and when they need to talk to each other, EJB is employed (Considering a web scenario). Do web services act as an alternative to EJB ? Any input on this is appreciated.
Thanx
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
hello
i think that kris is concerning more ahout that if the webservice can be an ALTERNATIVE to the ejb as distributed component.
from my side,i think that,from distributed architecture point of view,it is ok.
but from performence point of view,i don't test it,you can test it to see which one is more performent.
Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
In one way, you could simply think of web services as simply a different distributed component techology. One with different advantages & disadvantes (and possibly some similar characteristics as well). Another way of looking at this is that today at least, web services are more about distributed services capability. The key thing is that since services typically don't maintain session state, all you can do is make service style requests of them. That's not a bad thing necessarily, but it is important to realize that as a limitation or as a characteristic.
Originally posted by zb cong:
hello
i think that kris is concerning more ahout that if the webservice can be an ALTERNATIVE to the ejb as distributed component.
from my side,i think that,from distributed architecture point of view,it is ok.
but from performence point of view,i don't test it,you can test it to see which one is more performent.
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
Hi,
The Basic funda of Webservices is they are Truly platform independent. Webservices use the much accepted TCP/IP and XML (for SOAP and WSDL). Adoption to Webservices is high because of these two highly accepted technologies.Where as with J2EE the client also needs to be a java client. All the the earlier Distributed technologies were not truly platform independent. and EJB 2.1 and J2EE 1.4 includes webservices. J2EE with Webservices wold a powerful duo.

Cheers,
Gaya3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB vs Web Services
 
Similar Threads
.ear .war files
EJB3 in Action - Chapters to cover for the SCBCD exam
web services is replacement for EJB
Webservices certification
Container question