File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB or web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB or web service" Watch "EJB or web service" New topic
Author

EJB or web service

sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
If all the code is in Java, how to decide if use web service or EJB?

Thanks!
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Any idea?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
EJB and WS fulfill rather different roles. They don't compete with one another, but can complement each other. E.g., you might use a WS to expose the functionality of an EJB to another system or the outside world.

If you told us the details of the scenario you're thinking of, we might be better able to advise on which might be better suited.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740
    
  10

If you use the EJB all the code will be in java (both server and client). If you use Web Services, only the server will be in java, the client can be anything that will send/receive XML. Also, Web Services are generally considered to be slower since there's no way to avoid serializing/deserializing the objects (which some application servers can avoid with EJBs).
[ July 10, 2008: Message edited by: Scott Selikoff ]

[OCA 8 Book] [Blog]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB or web service
 
It's not a secret anymore!