File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Distributed systems, which protocol to use ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Distributed systems, which protocol to use ?" Watch "Distributed systems, which protocol to use ?" New topic
Author

Distributed systems, which protocol to use ?

Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 266
    
    1
Good evening to everyone here at java ranch...

I've implemented a complex system in which clients (Swing clients) require services execution via http calls. What I mean with "http calls" may be shown with this pseudo-code:



Now, by this mechanism the remote server receives an http request wich payload is the serialized form of context, which, in a nutshell, is an HashMap which encapsulates
all my parameters and attributes, i.e value object, i need to interchange with remote server.
Pretty insane ? Well, maybe... anyway, I'd like to discuss with you on this point.

Let's assume that serialized form of the context gets a certain amount, in terms of bytes.
I'm wondering if implementation via RMI or Web services may be more efficient, with respect to pure transmission latency. The question arises because while the above described approach works well in a LAN or VPN enviroments, via classical internet (DSL) connection isn't good.

I would bet that web services may be worse, because web services are basically http calls in which payload is XML, that in turn is generally more verbose than a pure serialization byte-to-byte of objects: so, if i'm experiencing troubles while working over DSL connection, I think i'd not solve my troubles using webservices instead of http calls.
Anyway, I'm in doubt regarding RMI, because i have no enough experience in this protocol... or, well, last time that I used RMI was before 2000....

Can anybody help me to understood ?
Thank you !
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5
I would bet that web services may be worse, because web services are basically http calls in which payload is XML, that in turn is generally more verbose than a pure serialization byte-to-byte of objects:


Your understanding of web services is out of date. It is only SOAP that requires XML formatted messages, a RESTful style can send anything.

This FAQ page on web services here at the ranch will help orient you.

What is the nature of your client population? One reason HTTP is so popular for situations like yours is that HTTP requests generally pass through firewalls whereas RMI would be blocked.

Bill

Java Resources at www.wbrogden.com
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 266
    
    1
Hi William,

thank you for your reply. I'll try to understand better how RESTful services work.. anyway, let's assume that we want use SOAP web services. We could always send only the full payload serialized as a (huge) String... so the overhead should be comparable to my http request...

May you suggest me anything about RMI protocol over internet ?
Thank you again for your time and helping.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5
Returning really large results from SOAP services can make use of the SAAJ (Soap with Attachments Api for Java) approach to avoid huge blocks of XML.

Search for SOAP JAVA SAAJ to get tutorials etc.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Distributed systems, which protocol to use ?
 
Similar Threads
RMH J2EE WS page 339
diffrence between SOAP and RMI
Protocols
My SCEA Part 1Study Notes
Some considerations about EJB and swing integration