{"id":675,"date":"2005-02-11T13:41:00","date_gmt":"2005-02-11T17:41:00","guid":{"rendered":"http:\/\/www.markbaker.ca\/wp\/2005\/02\/11\/steve-maine-boils-the-rest-vs-ws-disagreement-down-to-its-essence\/"},"modified":"2005-02-11T13:41:00","modified_gmt":"2005-02-11T17:41:00","slug":"steve-maine-boils-the-rest-vs-ws-disagreement-down-to-its-essence","status":"publish","type":"post","link":"http:\/\/www.markbaker.ca\/blog\/2005\/02\/steve-maine-boils-the-rest-vs-ws-disagreement-down-to-its-essence\/","title":{"rendered":"Steve Maine boils the REST-vs-WS disagreement down to its essence"},"content":{"rendered":"<p><em>Update<\/em>; mea culpa, it was of course Steve&#8217;s post, not Tim&#8217;s.  My apologies to both.\nOne of the disadvantages of reading blogs through Bloglines, since all the styling is lost.<\/p>\n\n<p>A thoroughly enjoyable\n<a href=\"http:\/\/hyperthink.net\/blog\/PermaLink,guid,46c804f0-1384-4752-9519-182d407f9253.aspx\">post<\/a>\nfrom Steve.  After a preamble on isomorphism, he presents an example SOAP message\nand asks;<\/p>\n\n<blockquote cite=\"http:\/\/hyperthink.net\/blog\/PermaLink,guid,46c804f0-1384-4752-9519-182d407f9253.aspx\">\nSo, an open question to the audience: are the SOAP messages I described above more &#8220;RPC style&#8221; or &#8220;document-oriented?&#8221; Are these services talking to each other, or stateful objects? Are you a good witch or a bad witch? To all these questions and others I answer: mu.\n<\/blockquote>\n\n<p>My answer is that they are RPC style.  Let me explain further\nin response to his conclusion, which reads;<\/p>\n\n<blockquote>\nAmazon.com&#8217;s e-commerce implementation is one of the most successful and highly touted REST API&#8217;s in existence today. The implications of the fact it&#8217;s also 100% structurally isomorphic to SOAP + WS-Addressing are left as an exercise to the reader.\n<\/blockquote>\n\n<p>Actually, it&#8217;s not isomorphic in that sense since the contract is <em>very<\/em>\ndifferent in the REST and WS\/SOA cases (does that fall under &#8220;structurally\nisomorphic&#8221;?  dunno).<\/p>\n\n<p>Let me start by tweaking Steve&#8217;s example to be what I would call a\n&#8220;document-oriented&#8221; style interaction;<\/p>\n\n<pre>&lt;S:Envelope xmlns:ht=&quot;<a href=\"http:\/\/schemas.hyperthink.net\/\">http:\/\/schemas.hyperthink.net<\/a>\/&quot; ... &gt;\n   &lt;S:Header&gt;\n     ...\n    &lt;wsa:To&gt;http:\/\/hyperthink.net\/xml&lt;\/wsa:To&gt;\n\n    &lt;wsa:MessageId&gt;uuid:123...&lt;\/wsa:MessageId&gt;\n    &lt;wsa:ReplyTo&gt; ... &lt;\/wsa:ReplyTo&gt;\n    &lt;ht:Service&gt;CommerceService&lt;\/ht:Service&gt;\n\n    &lt;ht:SubscriptionId&gt;12ABC&lt;\/ht:SubscriptionId&gt;\n     ...\n   &lt;\/S:Header&gt;\n   &lt;S:Body&gt;\n     &lt;ht:CartId&gt;47&lt;\/ht:CartId&gt;\n\n     &lt;ht:HMACToken&gt;[blah]&lt;\/ht:HMACToken&gt;\n   &lt;\/S:Body&gt;\n&lt;\/S:Envelope&gt;<\/pre>\n\n<p>Notice the difference?  wsa:Action has been removed.  So I could\nsubmit that message to a service, and it could return exactly the\nsame response as Steve&#8217;s example service does (though I&#8217;d remove\nthe wsa:Action from it too).<\/p>\n\n<p>Document in, document out.  Simple.<\/p>\n\n<p>Now, back to Steve&#8217;s Amazon URI based example.  My claim is\nthat the contract is different, just as the contract is different\nbetween Steve&#8217;s GetCart example and mine above.  Specifically, with the\nSOAP message, the request semantics are &#8220;GetCart&#8221;, and the response\nsemantics are &#8220;GetCart was successful&#8221;.  But in the URI example, the\nresponse semantics are &#8220;GET was successful&#8221; since the request semantics\nare GET.  In other words, with the URI, the client has zero visibility\ninto the semantics of the &#8220;GetCart&#8221; string (aka the URI is opaque), but\nin the SOAP message, it has full visibility.<\/p>\n\n<p>So rather than provide homework as Steve did 8-), I&#8217;ll ask\na single multiple choice question; what&#8217;s the operation in my\nSOAP message example above?  Is it;<\/p>\n\n<ul>\n<li>A. GetCart<\/li>\n<li>B. <a href=\"http:\/\/www.webservices.org\/index.php\/ws\/content\/view\/full\/45427\">ProcessMessage<\/a><\/li>\n<li>C. <a href=\"http:\/\/www.zvon.org\/tmRFC\/RFC2616\/Output\/chapter9.html#sub5\">POST<\/a><\/li>\n<li>D. B and C<\/li>\n<li>E. There is no operation<\/li>\n<\/ul>\n\n<p>Hint; there&#8217;s <em>always<\/em> an operation, since\n<em>something<\/em> has to succeed or fail.<\/p>","protected":false},"excerpt":{"rendered":"Update; mea culpa, it was of course Steve&#8217;s post, not Tim&#8217;s. My apologies to both. One of the disadvantages of reading blogs through Bloglines, since all the styling is lost. A thoroughly enjoyable post from Steve. After a preamble on isomorphism, he presents an example SOAP message and asks; So, an open question to the [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,40],"class_list":["post-675","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-soap","tag-xml"],"_links":{"self":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=675"}],"version-history":[{"count":0,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/675\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=675"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}