SOAP vs POX Debate, Part Three

(Editor’s note: This is the third part of a continued series of transcriptions from a conversation secretly recorded at an “after” party in San Francisco thrown by a company who shall remain nameless but rhymes with “oogle” during the JavaOne 2007 conference between Ted Neward and Adrian Trenaman, who were discussing the SOAP-vs-REST debate.)Ted: Here you go.

Adrian: Thanks. Cheers. (Sounds of clinking glasses.) Not bad. What’d the bartender say this was, again?

Ted: I think they’re calling it G-Wine. It’s in beta. See the ad on the glass?

Adrian: Neat. So you were saying something about YAGNI?

Ted: Oh, right. The REST/POX folks often argue that SOAP’s headers are an unnecessary complication, since HTTP already provides facilities for communicating data out-of-band like SOAP does, so therefore if I never needed to send some of those custom headers, HTTP already provides me what I need.

Adrian: True… though I admit I’m surprised that everybody assumes that we always want to send the data over HTTP.

Ted: That one catches me off-guard, too. Personally, I don’t like to run an HTTP server on machines that aren’t facing the outside world, particularly when there are faster protocols for communicating data within a subnet, or when I want semantics that HTTP can’t provide, like offline capabilities or recovery.

Adrian: You sound like you’re a big JMS fan!

Ted: Of any messaging system, in fact. JMS is just one of them. Funny thing is, when you look at SOAP, HTTP, JMS, and other messaging engines, you see a really close parallel in all of them: payload and headers.

Adrian: All the world’s communication is just messages, back and forth. We are but packets in the Internet of life.

Ted: (Laughs) Seriously, though, every RPC system I’ve ever seen is basically nothing more than a request/response message pair, with the client blocking on the response after sending the request. That’s part of the reason I don’t like WSDL that much, to be honest–it builds an unattractive abstraction on top of the messages I want to get hold of.

Adrian: Well, I dunno - as you know I’m well down with funky WSDL stuff. But the debate of either WSDL+SOAP vs XSD+XML is almost religious at this point - I have a feeling that people chooose a path and then just stick to it. I’ve seen a lot of folks recently reverting to using XML, particulary in a RESTful way.

Ted: Exactly - but then that’s the interesting thing. If you read the original Fielding thesis, or some of the later summarizations by Fielding, you realize that what he’s really arguing for is a communication architecture for a distributed hypermedia system that can scale anarchically.

Adrian: Ah yes - Anarchy. No central point of control: God Bless the Internet.

Ted: In a nutshell. Problem is, REST assumes that you want to carry all of the state in the payload itself, and for a modern enterprise system, or, hell, even for a game, that’s not always a safe assumption. REST has no sense of “session” because of that same reason: all you need to know about what happens next is contained in the document that’s sent back to you. Hence the reason cookies were never a part of the HTTP specification and why Fielding hates them so badly–they cramp the scalability of the Web server.

Adrian: So all those people arguing REST for enterprise systems….

Ted: … are basically arguing something they don’t understand, yep. In fact, if you read the dissertation, he’s arguing for a small vocabulary of verbs–

Adrian: –you mean like GET, PUT, POST, DELETE–

Ted: Yep, and that the data is accompanied by metadata describing the data and providing opportunities for extension–

Adrian: –such as the headers that accompany HTTP documents–

Ted: Yep, which sounds an awful lot like–

Adrian: SOAP! Ta da!

Ted: No kidding!

Adrian: Wow. That calls for another drink or four. Now. Lets prove that black == white…

(Editor’s note: The conversation paused while Adrian moved off to the bar to get a bottle of wine–a 2007 House Red–with which to continue the conversation. Our agent, stunned at the implications, immediately moved to secure the remainder of the discussion as they moved out into the hall outside.)

Read Part 2 - Read Part 4


Leave a Reply