Scott Hanselman

Mixing Metaphors and Making Things Too Complex (REST and SOAP)

October 27, 2004 Comment on this post [5] Posted in Web Services
Sponsored By

Folks keep trying to push metaphors (or similes, like, depending on how you say it) a smidge too far. Steve Maine had some words for Mark Baker. That said:

Patrick and I sat down to talk about this:

  • REST:
    • I write a letter, a document even, and it has no address on it and doesn't even say "Dear Patrick."
    • I tell the Postman, remembering that I'm only able to tell him two things, GET and POST, to take this letter to my friend Patrick.
      • POST /patrick.aspx HTTP/1.0
    • If the Postman puts the document (not a message, considering that he's the only one who knows where it's going) down on the seat, in order to Store and Foward this message - is it a letter? No, it's a document with no destination.
    • REST doesn't cover this. The address is out of band.  It's not on the "envelope" as there IS NO ENVELOPE.  Trying to say that the HTTP Headers are a Poor Man's Envelope succeed only in describing a very poor man.
  • SOAP
    • I write a letter, a document even, and it has no address on it and doesn't even say "Dear Patrick."
    • I put it in an envelope (also, a folded piece of paper, except this one has glue on it in certain places and a licky part) and put ATTN: Patrick (WS-Addressing) on the outside with some wax seals (WS-Security) and a Notary Public Stamp (WS-Trust).
    • If the Postman puts the document on his seat, the document (now a bona fide message) could be delivered by a substitute Postman.
    • Thus, SOAP adds, gasp, value by simply formalizing addressing, containment, and with WS*.*, security and trust.
    • And, it's transport independent. The Postman is free to use a Mule or a Segway.

How anyone can argue about this is beyond Patrick and I.

REST is interesting, and when simplicity is called for, knock yourself out.  But seriously, I can see why some may call them RESTafarians because more often than not "Hay now, Mista Postman, tak dis letta to mwa bwoy Patrix. Eim dwon undastan SOAP." doesn't cut it if you really want your letter to arrive.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
October 27, 2004 3:11
Nice.
October 27, 2004 3:27
Gracias. Seemed simple to me, no?
October 27, 2004 3:36
Patrick has a post on his blog as well:
http://www.cauldwell.net/patrick/blog/PermaLink,guid,9ba58b84-f978-4b49-8aa5-5c2c0e0c9458.aspx
October 27, 2004 4:57
Nice analogy.

If the postman always rings twice, can we cover that with ws-transaction or do we need ws-Igotthatalready ?
Ian
July 20, 2005 19:04
(just found this)

First, REST is an architectural style, not a protocol. If your message includes a representation (the letter), uses uniform semantics (POST), and is addressed to a single resource ("Patrick"), then congratulations, you're RESTful.

"It's not on the "envelope" as there IS NO ENVELOPE."

There *is* an envelope, it's the HTTP envelope (request line & headers). You normally write your address on the envelope, do you not? So saying "POST http://example.org/Patrick" seems like a sensible thing to do, using your analogy.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.