3

I would like to code a REST based HTTP API which is accessible from .NET and any other language like for example Python.

Should I use WCF for this? Or will that make the other languages harder to interop with my API?

I want the server to carry no state at all, and I want to be able to take advantage of HTTP persistent connections because a typical clinet will make many HTTP calls in a row. (maybe 2 hours straight of calls)

I am allowed to use .NET 4.

Darrel Miller
  • 139,164
  • 32
  • 194
  • 243
wcf guru needed
  • 117
  • 1
  • 7

4 Answers4

6

There is new stuff coming in WCF to support HTTP and REST. See, http://wcf.codeplex.com/

I wrote an intro blog post here http://www.bizcoder.com/index.php/2010/10/28/wcf-http/

Darrel Miller
  • 139,164
  • 32
  • 194
  • 243
  • The documentation is too sparse and it seems like it is changing too rapidly. I think this will be good maybe in a few months but as it is now I don't think it is good enough. – wcf guru needed Oct 31 '10 at 16:05
  • @wcf The point is you can start using System.ServiceModel.Web and you will be able to seamlessly migrate to the new stack when you are comfortable with its stability. – Darrel Miller Oct 31 '10 at 16:09
1

WCF can do about anything you'll need, but it has a steep learning curve. The REST Starter Kit from Microsoft is very helpful.

Another .NET REST framework is OpenRasta - I haven't personally used it, but I've heard good things about it.

Ben
  • 6,023
  • 1
  • 25
  • 40
1

You should consider WCF, ASP.NET MVC and WCF Data Services. This article has a reasonable discussion on the pros and cons of each appproach:

http://weblogs.asp.net/cibrax/archive/2010/10/08/asp-net-mvc-wcf-rest-and-data-services-when-to-use-what-for-restful-services.aspx

See also this SO question: ASP.NET MVC and WCF

Community
  • 1
  • 1
Ian Mercer
  • 38,490
  • 8
  • 97
  • 133
0

I suggest you try using WCF. Create a simple web service first (with only one call) and see if it suits your needs. Shouldn't take you long to do this. You may find this tutorial useful.

Bernard
  • 7,908
  • 2
  • 36
  • 33