{"id":1324,"date":"2006-03-14T11:58:00","date_gmt":"2006-03-14T15:58:00","guid":{"rendered":"http:\/\/www.markbaker.ca\/wp\/2006\/03\/14\/amazon-s3-soa-vs-rest-at-a-crossroads\/"},"modified":"2006-03-14T11:58:00","modified_gmt":"2006-03-14T15:58:00","slug":"amazon-s3-soa-vs-rest-at-a-crossroads","status":"publish","type":"post","link":"http:\/\/www.markbaker.ca\/blog\/2006\/03\/amazon-s3-soa-vs-rest-at-a-crossroads\/","title":{"rendered":"Amazon S3; SOA vs REST at a crossroads"},"content":{"rendered":"<p>Amazon has just announced a\n<a href=\"http:\/\/www.amazon.com\/gp\/browse.html\/ref=sc_fe_l_2\/102-1634764-6552153?%5Fencoding=UTF8&amp;node=16427261&amp;no=3435361&amp;me=A36L942TSJ2AJA\">storage service<\/a>\nwhich seems somewhat similar to\n<a href=\"http:\/\/base.google.com\">Google Base<\/a> (erm, apparently\nwe can\n<a href=\"http:\/\/blogs.zdnet.com\/Google\/?p=121\">expect<\/a>\n&#8220;Google Drive&#8221; shortly too).\nfrom a technology POV, though the business model &#8211; charging directly\nfor storage and bandwidth consumption &#8211; is quite different.<\/p>\n\n<p>What&#8217;s most interest here I think, is that it presents both a HTTP\nand SOAP (RPC) based interface.  But more than that, the HTTP interface is\n<a href=\"http:\/\/www.amazon.com\/gp\/aws\/sdk\/main.html?s=AmazonS3&amp;v=2006-03-01&amp;p=RESTObjectGET\">quite rich<\/a>.\nFor one, they haven&#8217;t made the\n<a href=\"http:\/\/www.markbaker.ca\/2002\/09\/Blog\/2005\/04\/14#2005-04-amazon-next\">common mistake<\/a>\nof putting operation names in URIs.  For another, they&#8217;re making use\nof &#8220;advanced&#8221; HTTP features like caching.  In fact, it appears as though the RESTful\ninterface was developed first.  How can I tell?  Because many of the HTTP\nheaders they used were simply replicated in their SOAP\/XML messages.  Yes, really.\nSee for yourselves.<\/p>\n\n<p>The HTTP GET response;<\/p>\n\n<pre>\nHTTP\/1.1 200 OK\nx-amz-id-2: j5ULAWpFbJQJpukUsZ4tfXVOjVZExLtEyNTvY5feC+hHIegsN5p578JLTVpkFrpL\nx-amz-request-id: BE39A20848A0D52B\nDate: Thu, 17 Nov 2005 08:22:38 GMT\nx-amz-meta-family: Muntz\nLast-Modified: Thu, 17 Nov 2005 08:22:38 GMT\nETag: \"828ef3fdfa96f00ad9f27c383fc9ac7f\"\nContent-Type: text\/plain\nContent-Length: 5\nConnection: close\nServer: AmazonS3\n\nHA-HA\n<\/pre>\n\n<p>And the (I assume) semantically equivalent SOAP response;<\/p>\n\n<pre>\n&lt;GetObjectResponse xmlns=\"http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\"&gt;\n  &lt;GetObjectResponse&gt;\n    &lt;Status&gt;\n      &lt;Code&gt;200&lt;\/Code&gt;\n      &lt;Description&gt;OK&lt;\/Description&gt;\n    &lt;\/Status&gt;\n    &lt;Metadata&gt;\n      &lt;Name&gt;Content-Type&lt;\/Name&gt;\n      &lt;Value&gt;text\/plain&lt;\/Value&gt;\n    &lt;\/Metadata&gt;\n    &lt;Metadata&gt;\n      &lt;Name&gt;family&lt;\/Name&gt;\n      &lt;Value&gt;Muntz&lt;\/Value&gt;\n    &lt;\/Metadata&gt;\n    &lt;Data&gt;aGEtaGE=&lt;\/Data&gt;\n    &lt;LastModified&gt;2005-11-18T01:25:07.994Z&lt;\/LastModified&gt;\n    &lt;ETag&gt;&amp;quot;828ef3fdfa96f00ad9f27c383fc9ac7f&amp;quot;&lt;\/ETag&gt;\n  &lt;\/GetObjectResponse&gt;\n&lt;\/GetObjectResponse&gt;\n<\/pre>\n\n<p>Ouch!  I honestly don&#8217;t know where to start.<\/p>\n\n<p>But what was wrong with simply supporting RESTful SOAP, and returning the\ndata wrapped in a SOAP envelope, adorned with (essentially) the same HTTP metadata\nas in the pure HTTP example above?  It would be returned if the HTTP request included a\n&#8220;Accept: application\/soap+xml&#8221; header.  That way you get to save face by telling\nfolks you support SOAP, while also getting all the benefits of reusing the Web.\n*shrug*<\/p>\n\n<p>I find it hard to believe that the bright folks at Amazon did this because\nthey felt it was useful.  I imagine there must have been a mandate that came down\nfrom up high dictating &#8220;All services must expose SOAP and REST interfaces&#8221;.\nBecause that SOAP interface is comical.  Nevermind\n<a href=\"http:\/\/www.oreillynet.com\/pub\/wlg\/3005\">85%\/15%<\/a>,\nI&#8217;d be surprised if <em>anybody<\/em> used it.<\/p>","protected":false},"excerpt":{"rendered":"Amazon has just announced a storage service which seems somewhat similar to Google Base (erm, apparently we can expect &#8220;Google Drive&#8221; shortly too). from a technology POV, though the business model &#8211; charging directly for storage and bandwidth consumption &#8211; is quite different. What&#8217;s most interest here I think, is that it presents both a [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[22,26,40],"class_list":["post-1324","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-rest","tag-soap","tag-xml"],"_links":{"self":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1324","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=1324"}],"version-history":[{"count":0,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1324\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=1324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=1324"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=1324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}