Yesup
 
 

Yamabay Knowledge Base

 

How to implment REST protocol in ASP.NET 2.0

Previous Article Back to TOC Next Article

In the world of Web Services, there are two standards: SOAP (Simple Object Access Protocol) and REST (REpresentional State Transfer). SOAP is the dominant protocol and is widely supported by most toolkits including .NET. The REST protocol, while less widespread, has a major advantage over SOAP: REST services are much simpler to call than SOAP services. Both Yahoo and eBay implement REST interfaces, while Amazon provides both SOAP and REST interfaces.


REST is particularly useful when we just want to access/update information from a remote database. For example, to get the inventory amount of certain parts, or to get information based on an employee id. All the Client code needs to do, is to send an URL which contains the information needed, and then wait for the REST Server to send the information back via HTTP. People can test REST without even write client side code, by just using a browser to type the right URL, like:


http://myRestSite/Inventory/PartA


To get the inventory amount of PartA. The URL has to be agreed upon Client and Server beforehand.


To implement REST at the Server, ASP.NET will need to use a ASP.NET 2.0 only class called VirtualPathProvifder. Once implemented and registered, the Provider will parse the URL sent from the Client, which can be just a browser or a Ajax script, or a Client Application use XMLHTTP, and then retrieve the correspond resource and send back to the client.


In addition to exploring the additional functionality available in with VirtualPathProviders, you should also take a deeper look at REST’s principles. The Wikipedia entry at http://en.wikipedia.org/wiki/Representational_State_Transfer is a good place to start.

Yesup
Top Stories Travel Movies Gift Ideas Free Software Games