<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>subbu.org &#187; REST</title>
	<atom:link href="http://www.subbu.org/blog/category/rest/feed" rel="self" type="application/rss+xml" />
	<link>http://www.subbu.org</link>
	<description>HTTP, REST and some Cycling</description>
	<lastBuildDate>Tue, 13 Jul 2010 00:09:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Slides from the Colorado Software Summit</title>
		<link>http://www.subbu.org/blog/2008/10/slides-from-the-colorado-software-summit</link>
		<comments>http://www.subbu.org/blog/2008/10/slides-from-the-colorado-software-summit#comments</comments>
		<pubDate>Mon, 27 Oct 2008 03:30:05 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.subbu.org/?p=535</guid>
		<description><![CDATA[I spent last week at 9300ft above the sea level at Keystone (CO) attending the Colorado Software Summit. This is one of the best conferences I have attended in a long time, with just about 300 attendees and serious sessions with very little fluff and absolutely no product/vendor pitch of any kind. This is one [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I spent last week at 9300ft above the sea level at Keystone (CO) attending the <a href="http://www.coloradosoftwaresummit.com/">Colorado Software Summit</a>. This is one of the best conferences I have attended in a long time, with just about 300 attendees and serious sessions with very little fluff and absolutely no product/vendor pitch of any kind. This is one conference that I can recommend to any one who value their money and time spent on conferences.</p>
<p>Here are the slides for my sessions:</p>
<p><span id="more-535"></span></p>
<p><strong>Pragmatic REST</strong>: This session is about building HTTP APIs RESTfully.</p>
<div style="width:425px;text-align:left" id="__ss_699233"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/sallamar/pragmatic-rest-presentation?type=powerpoint" title="Pragmatic Rest">Pragmatic Rest</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=pragmaticrest-1225213907285838-8&#038;stripped_title=pragmatic-rest-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=pragmaticrest-1225213907285838-8&#038;stripped_title=pragmatic-rest-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" href="http://www.slideshare.net/sallamar/pragmatic-rest-presentation?type=powerpoint" title="View Pragmatic Rest on SlideShare">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/rest">rest</a>)</div>
</div>
<p>Here is the <a href="http://www.subbu.org/uploads/2008/10/PragmaticREST.pdf">link</a> to download a PDF version.</p>
<p><strong>RESTful Web Apps</strong>: This session is about the RESTful aspects of the web, and how certain mainstream Java web frameworks make it harder to build web apps that play nice with the web architecture. My slides for this session are not as polished as I would have liked, but well &#8211; that&apos;s all the time I have.</p>
<div style="width:425px;text-align:left" id="__ss_699245"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/sallamar/restful-web-apps-facts-vs-fiction-presentation?type=powerpoint" title="RESTful Web Apps - Facts vs Fiction">RESTful Web Apps &#8211; Facts vs Fiction</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=restfulwebapps-1225214252037687-8&#038;stripped_title=restful-web-apps-facts-vs-fiction-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=restfulwebapps-1225214252037687-8&#038;stripped_title=restful-web-apps-facts-vs-fiction-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" href="http://www.slideshare.net/sallamar/restful-web-apps-facts-vs-fiction-presentation?type=powerpoint" title="View RESTful Web Apps - Facts vs Fiction on SlideShare">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own.</div>
</div>
<p>Here is the <a href="http://www.subbu.org/uploads/2008/10/RESTfulWebApps.pdf">link</a> to download a PDF version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/10/slides-from-the-colorado-software-summit/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Where Do Resources Come From?</title>
		<link>http://www.subbu.org/blog/2008/10/where-do-resources-come-from</link>
		<comments>http://www.subbu.org/blog/2008/10/where-do-resources-come-from#comments</comments>
		<pubDate>Thu, 23 Oct 2008 02:10:35 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.subbu.org/?p=522</guid>
		<description><![CDATA[Here is the approach I used in my session at the Colorado Software Summit on REST (I will post the slides over the weekend) to find resources.



Domain Nouns:  This is the most natural approach for finding resources, but it can end up with an inconvenient resource model. For instance, the NYT Movie Reviews API [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here is the approach I used in my session at the <a href="http://coloradosoftwaresummit.org">Colorado Software Summit</a> on REST (I will post the slides over the weekend) to find resources.</p>
<p><span id="more-522"></span></p>
<p><img src="http://www.subbu.org/uploads/2008/10/finding_resources.png" alt="Finding Resources" title="Finding Resources" /></p>
<ul>
<li><strong>Domain Nouns: </strong> This is the most natural approach for finding resources, but it can end up with an inconvenient resource model. For instance, the <a href="http://developer.nytimes.com/docs/movie_reviews_api/">NYT Movie Reviews API</a> has things like Movies, Reviews, Critics, Critic&apos;s picks, Reviews by reviewer identified as resources. These can provide a good starting point, but may not meet the needs of client apps, which leads to the next step.
    </li>
<li><strong>Composites: </strong> These are combinations of other resources, created primarily to address client app needs. Composites can also fix the urge for batching. An example is &quot;a user profile with 5 contacts plus favorite colors plus 10 latest updates&quot; identified as a single resource, so that the client developer can get with a single GET.
    </li>
<li><strong>Tasks and Processes: </strong> An example is an account transfer with some back-end process to complete the transfer at the end of the business day. Some in the audience wondered if it is RESTful to identify such an account transfer &quot;process&quot; (something that is typically identified as a verb). But why not? Such processes can be resources themselves with their own state and lifecycle.
    </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/10/where-do-resources-come-from/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Explaining State in HATEOAS</title>
		<link>http://www.subbu.org/blog/2008/10/explaining-state-in-hateoas</link>
		<comments>http://www.subbu.org/blog/2008/10/explaining-state-in-hateoas#comments</comments>
		<pubDate>Wed, 22 Oct 2008 15:16:22 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.subbu.org/?p=503</guid>
		<description><![CDATA[Explaining &#34;state&#34; in &#34;Hypermedia as the Engine of Application State&#34; (HATEOAS) is a bit tricky, particularly when you have to do it under two minutes.
The problem is that, the word &#34;state&#34; means different things to different people. For most of us coming from some background in web development, state usually involves numbers, strings, booleans, and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Explaining &quot;state&quot; in &quot;Hypermedia as the Engine of Application State&quot; (HATEOAS) is a bit tricky, particularly when you have to do it under two minutes.</p>
<p>The problem is that, the word &quot;state&quot; means different things to different people. For most of us coming from some background in web development, state usually involves numbers, strings, booleans, and other objects stored in some place, say, in an in-memory session. For instance, every beginner-level book on web development includes a shopping cart style sample that stores the cart in an in-memory session. If we extend that notion to understand or explain HATEOAS, it would make us jump to the conclusion that, to make hypermedia as the engine of application state, the server will have to encode similar objects into some XML or such form of representation in response to each request. This line of thinking is a trap.</p>
<p><span id="more-503"></span></p>
<p>Here is why. Once the server includes such state in a representation, the next step for the client is to replay the state in future requests to the server. Then we are talking about exchanging those objects back and forth, and not every HTTP verb has enough room to carry that state. This line of thinking will then start to shoot holes into the notion of a uniform interface because, to fit the state in a request, the client may have to resort to POST. I can almost see message passing over POST as the next logical step. At this stage, whoever is trying to explain HATEOAS may have make some lame excuses and move on. Whoever is listening will then conclude that &quot;yeah, this won&apos;t work for my apps&quot;. </p>
<p>Here is an example that I find most useful to explain the &quot;state&quot; in HATEOAS.</p>
<blockquote>
<p>There are three pages in a UI. The first page has a link to go to the second page. The second page has a link to go to the previous page as well as the third page. The third has a link to the second page and another link to the first page.</p>
<p>A client starts from the first page, and then through the link on that page, goes to the second page. The fact that this page has one link to the first page and another to the third page implies that the current state of the application (i.e. the interactions) is that &quot;the client is viewing the second page&quot;. That is what it means by hypermedia as the engine of application state. It does not necessarily mean serializing application state, such as &quot;<code>&lt;page&gt;2&lt;/page&gt;</code>&quot; into representations. </p>
</blockquote>
<p>I admit that I am simplifying this a bit. The point is that state does not necessarily mean some data stored in representations. HATEOAS means that representations reflect the current state of the app through <a href="http://www.subbu.org/blog/2008/10/generalized-linking">links</a> with known relations. Those links may contain opaque references to some persistent state on the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/10/explaining-state-in-hateoas/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>application/xxx+json</title>
		<link>http://www.subbu.org/blog/2008/10/applicationxxxjson</link>
		<comments>http://www.subbu.org/blog/2008/10/applicationxxxjson#comments</comments>
		<pubDate>Thu, 09 Oct 2008 22:57:59 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[WADL]]></category>

		<guid isPermaLink="false">http://www.subbu.org/?p=453</guid>
		<description><![CDATA[Why did RFC-4267 not leave room for a JSON-family of representations?  For XML, RFC 3023 formally defined XML-based media types using the &#34;+xml&#34; naming convention, so that clients (e.g. XMLHttpRequest) can recognize any XMLish media type as long as the media type follows this convention. But not so for JSON?
]]></description>
			<content:encoded><![CDATA[<p></p><p>Why did <a href="http://www.ietf.org/rfc/rfc4627.txt">RFC-4267</a> not leave room for a JSON-family of representations?  For XML, <a href="http://www.ietf.org/rfc/rfc3023.txt">RFC 3023</a> formally defined <em>XML-based media types</em> using the &quot;+xml&quot; naming convention, so that clients (e.g. <a href="http://www.w3.org/TR/XMLHttpRequest/">XMLHttpRequest</a>) can recognize any XMLish media type as long as the media type follows this convention. But not so for JSON?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/10/applicationxxxjson/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>On Partial Representations</title>
		<link>http://www.subbu.org/blog/2008/09/on-partial-representations</link>
		<comments>http://www.subbu.org/blog/2008/09/on-partial-representations#comments</comments>
		<pubDate>Mon, 22 Sep 2008 01:41:17 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.subbu.org/?p=296</guid>
		<description><![CDATA[A partial representation is one where the client would ask for a specific bits and pieces of a representation, such as Amazon serving a partial representation of a book containing just the table of contents, or just the reviews and comments. The problem is quite simple, and a  solution like the following would work:

GET /book/0-374-29288-4?view=toc
GET [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A partial representation is one where the client would ask for a specific bits and pieces of a representation, such as Amazon serving a partial representation of a book containing just the table of contents, or just the reviews and comments. The problem is quite simple, and a  solution like the following would work:</p>
<pre name="code" class="http">
GET /book/0-374-29288-4?view=toc
GET /book/0-374-29288-4?view=reviews
GET /book/0-374-29288-4?fields=reviews,comments
</pre>
<p><span id="more-296"></span></p>
<p>At Yahoo!, we call this the &quot;view&quot; pattern. The key thing to note here is that the names of views or fields don&apos;t necessarily refer to particular members of representations &#8211; such as elements/attributes in XML-family of representations or properties in JSON representations. It is up to the server to define what the values of those parameters mean. They could potentially mean inclusion/exclusion of different members of representations in particular media types. This way, we can let URIs remain decoupled from particular media types. I consider this important to let the system evolve to support conneg for what it is designed for.</p>
<p>Flickr solves the same use case by taking an <code>extras</code> query parameter with a list of fields to include for its <a href="http://www.flickr.com/services/api/flickr.photos.search.html">search</a> API.</p>
<p>Another reason we adopted this pattern for serving partial representations is that this approach lets us link to those representations, as in</p>
<pre name="code" class="xml">
&lt;link href="/book/0-374-29288-4?view=toc" rel="view"/&gt;
&lt;link href="/book/0-374-29288-4?view=reviews" rel="view"/&gt;
&lt;link href="/book/0-374-29288-4?fields=reviews,comments" rel="view"/&gt;
</pre>
<p>By being able to link like this, we can take advantage of HATEOAS as well as do some interesting things that only opaque URIs let us do.</p>
<p>Although this approach is quite common, once in a while we come across some proposals that deserve a bit more scrutiny.</p>
<p>The most recent approaches that I came across with are from the <a href="http://groups.google.com/group/restful-json/msg/94834c62b0fbd90a?">RESTful JSON</a> proposal. The first is based on a new &quot;<code>locator</code>&quot; media type parameter. In this model, a client would include a header such as</p>
<pre name="code" class="http">
Content-Type: application/json;locator=my_id[{"my_id":"1","name":"John Doe"},{"my_id":"2","name":"Jane Doe"}]
</pre>
<p>The idea of this locator is to identify a sub-resource. This is an interesting but questionable usage of the Content-Type header. I say questionable because the purpose of the <code>Content-Type</code> header is to indicate the media type of the entity enclosed in the body of a request or a response. Here, what is included is not just a media type of the entity. It is also encoding data, thus mixing up resource naming and resource data. In RESTful systems, we use URIs to name resources, and let headers provide metadata of a request/response or the entity enclosed within a request/response.</p>
<p>The same proposal includes another idea to deal with partial representations of collections of resources. That is to rely on the <code>Range</code> and <code>Content-Range</code> headers. Here is an example.</p>
<pre name="code" class="http">
GET /Person/ HTTP/1.1
Range: items=0-1

Content-Range: items 0-1/33

...
</pre>
<p>Here, the client is asking for the first two elements of a collection using the <code>Range</code> header.</p>
<p>In HTTP, Both <code>Content-Range</code> and <code>Range</code> headers describe byte ranges. See Sec 3.12 of RFC 2616, which recognizes &quot;bytes&quot; as the unit of content range. RFC 2616 does allow extensions, but software that can recognize byte ranges is likely going to trip when it sees extensions like this.</p>
<p>Most importantly, both these approaches prevent linking. You can&apos;t claim a solution to be RESTful if you can&#8217;t use it to link to a resource or a representation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/09/on-partial-representations/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>POX Interpretation of REST</title>
		<link>http://www.subbu.org/blog/2008/07/pox-interpretation-of-rest</link>
		<comments>http://www.subbu.org/blog/2008/07/pox-interpretation-of-rest#comments</comments>
		<pubDate>Thu, 24 Jul 2008 20:42:13 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2008/07/pox-interpretation-of-rest/</guid>
		<description><![CDATA[Sanjiva says

Oh yeah we support both WS-* and RESTful services. However, they won&#8217;t meet the RESTafarian fanatics like Tim Bray&#8217;s coolaid drunkenness level of REST .. but if you want to do pragmatic work with services and support either or both of WS-* and REST then take a look at Apache Axis2 (Java &#038; C), [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sanjiva <a href="http://sanjiva.weerawarana.org/2008/07/its-over-hump-tim-give-it-rest.html">says</a></p>
<blockquote><p>
Oh yeah we support both WS-* and RESTful services. However, they won&#8217;t meet the RESTafarian fanatics like Tim Bray&#8217;s coolaid drunkenness level of REST .. but if you want to do pragmatic work with services and support either or both of WS-* and REST then take a look at Apache Axis2 (Java &#038; C), WSO2 WSAS, WSO2 Mashup Server, WSO2 WSF/{C,C++,PHP,Perl} etc&#8230;
</p></blockquote>
<p>Is supporting a uniform interface (REST) and a non-uniform interface (WS-*) at the same time in a given server possible without violating some or all the constraints of REST? Or, is this approach, which was expressed by several others (sorry &#8211; don&#8217;t have references handy), based on the POX interpretation of REST (i.e. transport some XML over HTTP treating HTTP as though it is just wire-level protocol)?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/07/pox-interpretation-of-rest/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OpenSocial RPC</title>
		<link>http://www.subbu.org/blog/2008/07/opensocial-rpc</link>
		<comments>http://www.subbu.org/blog/2008/07/opensocial-rpc#comments</comments>
		<pubDate>Fri, 18 Jul 2008 10:47:31 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2008/07/opensocial-rpc/</guid>
		<description><![CDATA[Apparently there is a JSON-RPC working group and a proposal to marshal RPC over HTTP. The description is quite simple:


JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. It uses JSON (RFC 4627) as data format, and is transport-independent. It&#8217;s designed to be simple!

The abuse is clear from the proposed OpenSocial JSON-RPC API.

POST /jsonrpc [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Apparently there is a <a href="http://groups.google.com/group/json-rpc/web/json-rpc-1-2-proposal">JSON-RPC</a> working group and a proposal to marshal RPC over HTTP. The description is quite simple:</p>
<p><span id="more-196"></span></p>
<blockquote><p>
JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. It uses JSON (RFC 4627) as data format, and is transport-independent. It&#8217;s designed to be simple!
</p></blockquote>
<p>The abuse is clear from the proposed <a href="http://docs.google.com/View?docid=dhjrqr8t_4cwzqq7gh">OpenSocial JSON-RPC API</a>.</p>
<pre name="code" class="http">
POST /jsonrpc HTTP/1.1
Host: api.example.org
Authorization: &lt;Auth token&gt;
Content-Type: application/json
{
"method" : "people.get",
"id" : "myself"
"params" : {
"userid" : "@me",
"groupid" : "@self"
}
}
</pre>
<p>But what is so <em>un-simple</em> about the right approach?</p>
<pre name="code" class="http">
GET /people?... HTTP/1.1
Host: api.example.org
Authorization: &lt;Auth token&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/07/opensocial-rpc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST &#8211; Wondering about Interop?</title>
		<link>http://www.subbu.org/blog/2008/07/rest-wondering-about-interop</link>
		<comments>http://www.subbu.org/blog/2008/07/rest-wondering-about-interop#comments</comments>
		<pubDate>Tue, 15 Jul 2008 19:05:12 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2008/07/rest-wondering-about-interop/</guid>
		<description><![CDATA[Sergey Beryozkin is wondering about 

is it what actually defines Web Services ? Not only the actual technology per se but the fact that multiple businesses can do the same technology and successfully interoperate?
Will it ever happen with RESTful services ? Will it be possible for multiple companies to interoperate with more sophisticated things involved [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sergey Beryozkin is <a href="http://sberyozkin.blogspot.com/2008/07/is-it-all-about-agreement.html">wondering</a> about </p>
<blockquote>
<p>is it what actually defines Web Services ? Not only the actual technology per se but the fact that multiple businesses can do the same technology and successfully interoperate?</p>
<p>Will it ever happen with RESTful services ? Will it be possible for multiple companies to interoperate with more sophisticated things involved such as transactions, for ex, something which is possible to do with WS-BusinessActivity which does not really lock all involved ?</p>
<p>&#8230;</p>
<p>Or is it something which will not be ever needed in practice ?</p>
</blockquote>
<p><span id="more-195"></span></p>
<p>The fact that I am using a client (i.e. the browser) that uses the <em>hypermedia</em> provided by my blog server to create/update representations of <em>resources</em>  <em>identified</em> by URIs via a <em>uniform interface</em> (HTTP) demonstrates the interoperability of applications built upon the REST architectural style.</p>
<p>The question about transactions and REST often stems from the misconception of equating POX over HTTP to REST. Unfortunately, POX over HTTP is not the same as REST. What gets tested for interoperability under WS-* (such as understanding SOAP body/headers, serializing/deserializing different XML constructs, faults etc) is not necessarily the same for REST (implementing the uniform interface, understanding media types and hypermedia etc.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/07/rest-wondering-about-interop/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Resource Access Spin</title>
		<link>http://www.subbu.org/blog/2008/07/resource-access-spin</link>
		<comments>http://www.subbu.org/blog/2008/07/resource-access-spin#comments</comments>
		<pubDate>Tue, 15 Jul 2008 11:32:29 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2008/07/resource-access-spin/</guid>
		<description><![CDATA[What is striking about the WS-Empire striking back (borrowing from Mark&#8217;s post) is not the attempt to &#34;standardize&#34; certain new features for SOAP messages, but the apparent lack (or break-down) of a cohesive guiding principle for architecting SOAP-based web services. I&#8217;m referring to WS-ResourceTransfer here.

Let me get to the basics. According to SOAP 1.2, 

SOAP [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>What is striking about the WS-Empire striking back (borrowing from Mark&#8217;s <a href="http://www.mnot.net/blog/2008/07/04/a_new_dread">post</a>) is not the attempt to &quot;standardize&quot; certain new features for SOAP messages, but the apparent lack (or break-down) of a cohesive guiding principle for architecting SOAP-based web services. I&#8217;m referring to <a href="http://www.ibm.com/developerworks/library/specification/ws-wsrt/">WS-ResourceTransfer</a> here.</p>
<p><span id="more-194"></span></p>
<p>Let me get to the basics. According to <a href="http://www.w3.org/TR/soap12-part1/">SOAP 1.2</a>, </p>
<blockquote><p>
SOAP Version 1.2 is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. &#8230; using XML technologies, an extensible messaging framework containing a message construct that can be exchanged over a variety of underlying protocols.
</p></blockquote>
<p>If I buy into this model, I would take it that the message describes everything &#8211; the operation/verb, the data, and any additional instructions to process the data. </p>
<p>But if we look at WS-ResourceTransfer, it says that</p>
<blockquote><p>
it intends to form an essential core component of a unified resource access protocol for the Web services space&#8230;
</p></blockquote>
<p>and then goes on to define <em>a standardized technique for accessing resources</em> using <em>semantics familiar to those in the system management domain: get, put, create and delete</em>.</p>
<p>What? One of the strongest arguments in the REST vs WS-* debate so far has been that a uniform interface (as in REST) is not adequate to describe the varieties of operations that enterprises need to do (with WS-*). But then why attempt to define a uniform interface <em>familiar to those in the system management domain</em> when the WS-* side concluded that uniform interfaces don&#8217;t meet the needs? Looks like a <a href="http://stage.vambenepe.com/archives/225">resource access</a> spin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/07/resource-access-spin/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another REST Anti-Pattern</title>
		<link>http://www.subbu.org/blog/2008/07/another-rest-anti-pattern</link>
		<comments>http://www.subbu.org/blog/2008/07/another-rest-anti-pattern#comments</comments>
		<pubDate>Thu, 10 Jul 2008 21:15:15 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2008/07/another-rest-anti-pattern/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>Here is an addition to the <a href="http://www.infoq.com/articles/rest-anti-patterns">list of anti-patterns</a> that Stefan recently posted. The pattern is to let the client &quot;think&quot; that is using verbs other than GET and POST, but piggyback such requests over GET or POST. <span style="text-decoration: line-through;">This was originally started by the <a href="http://code.google.com/apis/gdata/basics.html">GData</a> folks via the <code>X-HTTP-Method-Override</code> header.</span> Rails came along and baked its version for faking PUT, and DELETE over POST.</p>
<p><span id="more-190"></span></p>
<p>Let me start with a Rails example.</p>
<pre name="code" language="http">
&lt;%= link_to "Delete Image", @image, :confirm => "Are you sure?", :method => :delete %&gt;
</pre>
<p>This is from the <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001598">Rails API documentation</a>.</p>
<p>Here, the intent is to let the client submit a DELETE request to delete a resource. Given that HTML forms do not support DELETE, Rails generates the following HTML:</p>
<pre name="code" language="html">
&lt;a href="/images/9" onclick="if (confirm('Are you sure?')) { var f = document.createElement('form');
f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;
var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method');
m.setAttribute('value', 'delete'); f.appendChild(m);f.submit(); };return false;">Delete Image&lt;/a&gt;
</pre>
<p>When clicked, this creates an HTML form with method POST, and submits it.</p>
<p>What good is this for? I can&#8217;t think of any. As far as HTTP is concerned, it is a regular POST and all the rules for POST apply. The browser is still submitting a POST request. The server-side may think that it is implementing a DELETE, but it is of no consequence as far as the client and HTTP are concerned.</p>
<p><span style="text-decoration: line-through">The same is the case with <code>X-HTTP-Method-Override</code></a>. Patterns like this are misleadingly simple, and completely worthless.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2008/07/another-rest-anti-pattern/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
