Philosophical Split Hurts Web Services Adoption
Avidwriter writes "'There is a serious split in Web services implementation philosophy that is threatening to stall the benefits of the technology to businesses and consumers,' says this Devchannel story. 'The WSDL 1.1 specification allows programmers to choose between remote procedure call (RPC) style and document-style Web services. The decision is not an arbitrary one, as it has ramifications for both message structure and more importantly the interoperability of Web services...'"
SOAP, particularly as it matures into 1.2, is moving away from the RPC model to a most REST model. So while your point is good, don't paint SOAP with that brush.
Mr. Daconta has chosen a very contrived example to support his argument. A tree-structured taxonomy fits very nicely into a DOM-style response, but fits poorly into a Hashmap. Ergo, since his document-style request returns a DOM and his RPC-style request returns a Hashmap, the Document-style request is always superior. This is complete bullshit. Either way could be easier to implement and result in a more natural response, depending on the situation.
A Hashmap is a lousy and unnatural way of representing a tree structure in the first place. Why would sending it over a wire in response to a SOAP call result in any less awkwardness at the other end? What if the taxonomy was represented as vectors and sub-vectors? This would allow a much more natural representation, and would result in a much clearer output in response to a SOAP call.
What if the underlying structure was not hierarchical, but was instead a bi-directional circular linked list? Expressing this in a DOM object is possible, but it's ugly and does not flow naturally.
Another thing to notice is how much code was written for the two examples. The RPC-style code is a mere 45 lines total. The Document-style code is shows 130 lines, but notes that many more lines were omitted. At 7 lines per omitted item from class7 to class21, that's another 105 lines, for a total of 235 lines. If you're going to put 5 times as much effort into the result, it's not surprising that you get back a much cleaner response.
Daconta's article should be moderated as "-1 Troll" IMNSHO.
--Paul