<?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>Bhavin's Blog &#187; rest</title>
	<atom:link href="http://bhavin.directi.com/tag/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://bhavin.directi.com</link>
	<description></description>
	<lastBuildDate>Fri, 05 Aug 2011 12:27:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx XSLT Module for REST Servers</title>
		<link>http://bhavin.directi.com/nginx-xslt-module-for-rest-servers/</link>
		<comments>http://bhavin.directi.com/nginx-xslt-module-for-rest-servers/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 05:57:14 +0000</pubDate>
		<dc:creator>Bhavin Turakhia</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://bhavin.directi.com/?p=158</guid>
		<description><![CDATA[I just came across the Nginx XSLT module and had an epiphany. The module essentially accepts an HTTP request, passes it through to the backend server, receives XML from the backend server, and converts the XML to HTML by applying XSLT transforms as per XSLT stylesheets available.
So now one can essentially focus solely on a [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across the <a href="http://wiki.nginx.org/NginxHttpXsltModule">Nginx XSLT module</a> and had an epiphany. The module essentially accepts an HTTP request, passes it through to the backend server, receives XML from the backend server, and converts the XML to HTML by applying XSLT transforms as per XSLT stylesheets available.</p>
<p>So now one can essentially focus solely on a REST-XML-HTTP API when building out an application, and expose the same as an API as well as a web app by simply creating XSLT files that transform the XML into HTML. Kickass!!!<a href="http://bhavin.directi.com/wp-content/uploads/2009/06/nginx.gif"></a></p>
<p><a href="http://bhavin.directi.com/wp-content/uploads/2009/06/nginx.gif"><img class="alignleft size-full wp-image-159" title="nginx" src="http://bhavin.directi.com/wp-content/uploads/2009/06/nginx.gif" alt="" width="379" height="222" /></a></p>
 <img src="http://bhavin.directi.com/wp-content/plugins/feed-statistics.php?view=1&post_id=158" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://bhavin.directi.com/nginx-xslt-module-for-rest-servers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTTP vs REST vs SOAP</title>
		<link>http://bhavin.directi.com/http-vs-rest-vs-soap/</link>
		<comments>http://bhavin.directi.com/http-vs-rest-vs-soap/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 10:42:38 +0000</pubDate>
		<dc:creator>Bhavin Turakhia</dc:creator>
				<category><![CDATA[0-cosmos]]></category>
		<category><![CDATA[TechTalk]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml-http]]></category>

		<guid isPermaLink="false">http://bhavin.directi.com/?p=122</guid>
		<description><![CDATA[I have been an active proponent of SOAP since its inception. SOAP revolutionzed RPC and loose coupling to a great extent. However off late I have been giving APIs and interfaces considerable thought and am leaning a lot more towards simple HTTP based APIs with an XML or JSON response format as opposed to SOAP. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been an active proponent of SOAP since its inception. SOAP revolutionzed RPC and loose coupling to a great extent. However off late I have been giving APIs and interfaces considerable thought and am leaning a lot more towards simple HTTP based APIs with an XML or JSON response format as opposed to SOAP. In this post I pen down some random thoughts on the merits and demerits of each.</p>
<p><strong>Introduction</strong><br />
Let me first clarify the terminology -</p>
<ul>
<li>SOAP refers to Simple Object Access Protocol</li>
<li>HTTP based APIs refer to APIs that are exposed as one or more HTTP URIs and typical responses are in XML / JSON. Response schemas are custom per object</li>
<li>REST on the other hand adds an element of using standrdized URIs, and also giving importance to the HTTP verb used (ie GET / POST / PUT etc)</li>
</ul>
<p><strong>Typing</strong><br />
SOAP provides relatively stronger typing since it has a fixed set of supported data types. It therefore guarantees that a return value will be available directly in the corresponding native type in a particular platform. Incase of HTTP based APIs the return value needs to be de-serialized from XML, and then type-casted. This may not represent much effort, especially for dynamic languages. Infact, even incase of copmlex objects, traversing an object is very similar to traversing an XML tree, so there is no definitive advantage in terms of ease of client-side coding.</p>
<p><strong>Client-side effort</strong><br />
Making calls to an HTTP API is significantly easier than making calls to a SOAP API. The latter requires a client library, a stub and a learning curve. The former is native to all programming languages and simply involves constructing an HTTP request with appropriate parameters appended to it. Even psychologically the former seems like much less effort.</p>
<p><strong>Testing and Troubleshooting</strong><br />
It is also easy to test and troubleshoot an HTTP API since one can construct a call with nothing more than a browser and check the response inside the browser window itself. No troubleshooting tools are required to generate a request / response cycle. In this lies the primary power of HTTP based APIs</p>
<p><strong>Server-side effort</strong><br />
Most Programming languages make it extremely easy to expose a method using SOAP. The serialization and deserialization is handled by the SOAP Server library. To expose an object&#8217;s methods as an HTTP API can be relatively more challenging since it may require serialization of output to XML. Making the API Rest-y involves additional work to map URI paths to specific handlers and to import the meaning of the HTTP request in the scheme of things. Offcourse many frameworks exist to make this task easier. Nevertheless, as of today, it is still easier to expose a set of methods using SOAP than it is to expose them using regular HTTP.</p>
<p><strong>Caching</strong><br />
Since HTTP based / Rest-ful APIs can be consumed using simple GET requests, intermediate proxy servers / reverse-proxies can cache their response very easily. On the other hand, SOAP requests use POST and require a complex XML request to be created which makes response-caching difficult</p>
<p><strong>Conclusions</strong><br />
In the end I believe SOAP requires greater implementation effort and understanding on the client side while HTTP based or REST based APIs require greater implementation effort on the server side. API adoption can increase considerably if a HTTP based interface is provided. Infact an HTTP-based API with XML/JSON responses represents the best of both breeds and is easy to implement on the server as well as easy to consume from a client</p>
 <img src="http://bhavin.directi.com/wp-content/plugins/feed-statistics.php?view=1&post_id=122" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://bhavin.directi.com/http-vs-rest-vs-soap/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

