This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Webservices VS RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservices VS RMI" Watch "Webservices VS RMI" New topic
Author

Webservices VS RMI

prem saggar
Ranch Hand

Joined: Aug 24, 2000
Posts: 66
Hi guys. I have a few questions about Webservies vs RMI. First;

1) Does a solution using webservices handle "garbage collection"? E.g., if I pass a custom data type like a Frog object via a webservice, will it be garbage collected when no longer used?

2) Can I even pass a custom data type like a Frog object via a Webservice, and have it used properly on the client side? Will a Frog object be understood by a .Net client?

3) How difficult are asynchronous webservices? Are they poor in performance?

4) RMI can handle garbage collection, and passing custom data types, but RMI only works with Java to Java. Is it true that Webservices allow any type of client to consume a webservice, e.g., a webservice written in Java can be consumed by a .Net, C++, or even Perl client?

Thanks guys, I'm really curious about these questions. I believe that if webservices can do all that I asked above, then this webservice thing is for real.

Thanks,
Prem
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Does a solution using webservices handle "garbage collection"? E.g., if I pass a custom data type like a Frog object via a webservice, will it be garbage collected when no longer used?
Garbage collection has nothing to do with web services. Any objects you create in order to send a SOAP message will exist only within your chosen platform and will be garbage collected just like any other object.

Can I even pass a custom data type like a Frog object via a Webservice, and have it used properly on the client side? Will a Frog object be understood by a .Net client?
Yes, you can pass custom objects but you need to 1) map them explicitly using whatever means your web services engine provides. On the receiving end, a similar mapping needs to be done.

How difficult are asynchronous webservices? Are they poor in performance?
The difficulty depends on what you're trying to do, and on the tools you're using. Obviously asynchronous web services are more complex, and thus more difficult, than synchronous web services.

Regarding the question of performance, you really need to define what you mean by "performance" -- an asynchronous solution is by definition always "slower" than the synchronous alternative (because you're making two requests instead of just one), but the asynchronous solution scales a lot better than the synchronous solution under heavy load.

Is it true that Webservices allow any type of client to consume a webservice, e.g., a webservice written in Java can be consumed by a .Net, C++, or even Perl client?
Yes, it's true.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
prem saggar
Ranch Hand

Joined: Aug 24, 2000
Posts: 66
Hey thanks for the info! I really appreciate it. Do you know of a good source of info for webservices? Directed mostly to the questions I just asked? Thanks so much, Prem
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The best source would probably be either Google or J2EE Web Services.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What was I thinking. Obviously forums like JavaRanch are great resources for learning -- you can't ask questions from a book, and Google isn't that smart...
prem saggar
Ranch Hand

Joined: Aug 24, 2000
Posts: 66
Is it me, or is it impossible to learn webservices! I tried reading books, and I'm getting sleepy . I tried using axis, and that is better, but still tough. HELP, how do I learn this stuff!!! Prem :roll:
Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 276
Originally posted by prem saggar:
Is it me, or is it impossible to learn webservices! I tried reading books, and I'm getting sleepy . I tried using axis, and that is better, but still tough. HELP, how do I learn this stuff!!! Prem :roll:



Preach it bother!

Is there not a good overview with an in depth tutorial maybe?
Kuldeep Vaishnav
Ranch Hand

Joined: May 23, 2004
Posts: 72
I think the webservices tutorial on SUN site is pretty comprehensive.It covers almost all the APIs like JAX-RPC,JAXP,JAXB,SAAJ etc etc. Theres also a step by step guideline about how to generate client and service side on Apache website somewhere (I forgot the exact location...sorry)..Also IBM has some material on this (infact talks more about developing webservices using websphere.But still can give some guidelines...)..and again you can always ask questions on forums like javaranch...

K

P.S: I apologise for not providing exact URLs and stuff like that but I am kinda running short on time right now..may be I will come back later and add those pointers..Thanks for bearing.


Kuldeep
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Webservices VS RMI
 
Similar Threads
encoding style: literal vs encoded
interoperability to what extent?
Socket vs RMI vs Servlets
RMI vs WebServices
Using Unreferenced vs a daemon thread