Tuesday, May 19, 2009

Implementing REST using WCF

REpresentational State Transfer is an architectural approach which treats the url as resource pointer which is more human readable by its syntax.

For example see the Google Picasa urls.They just denote the resource rather than a physical aspx, php or html files.Below is the link to my picasa home page.It just says my username alone.
http://picasaweb.google.com/joymon/

If we navigate again into any album the url will change and that again point to a resource than a file with query strings.
http://picasaweb.google.com/joymon/Identitymine_Anniversary_23Jan2009#

Don’t think that there is some magic going on.Internally this url is getting mapped to a file which process and outputs the required data as html format.Hope the concept is clear.
The main advantage of this approach is simplicity.Urls are all predictable and easy to remember.
Links to implement this in WCF
http://blogs.msdn.com/bags/archive/2008/08/05/rest-in-wcf-blog-series-index.aspx
http://msdn.microsoft.com/en-us/netframework/cc950529.aspx

No comments: