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....
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.
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.
Author and all-around good cowpoke
Joined: Mar 22, 2000
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.