views:

65

answers:

2

I have developed an rest enable wcf service by using the following link

http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx

Now I want to know is there any difference between rest enabled wcf service (or restful web service) & rest web service ? If there is any difference then what is that ? If there is difference the can you provide me any link (which represents steps visually as in above link) through which I can develop rest web service ?

A: 

I do not know what you mean about the "REST web service" but basically you can do RESTful web services in .NET in two ways:

1) WCF which you have done although in .NET 4.0 there is no need fo .svc file

2) Using ASP.NET MVC which is RESTful anyway and you have to retun JsonResult or XmlResult.

Aliostad
Or you can use OpenRasta, or you can build straight off HttpListener, or one of the many other alternatives.
Darrel Miller
... or from ASP.NET non MVC pages or HttpHandlers, and so on, it's not like ASP.NET made it impossible to do the RESTful stuff people had done in classic ASP or in PHP until MVC came along. You certainly don't have to return Json or Xml, you can return anything as long as it uses URIs to indicate related resources so that it keeps with the HATEOAS constraint. If there are no "further" related resources then any content type at all will do; it could be image/png even.
Jon Hanna
A: 

The R in REST stands for Resource. The idea is that there are basically 4 methods: GET, PUT, POST, and DELETE, and they all operate on RESOURCES, i.e., NOUNS. The article you reference uses the REST architecture and WCF to produce a non-rest-ful example, in that the author is using "VERBS".

Here is an article that better explains what REST is and how WCF allows you to implement in it.

http://msdn.microsoft.com/en-us/library/dd203052.aspx

Les