Creating RESTful Web Services with WCF 3.5

My inaugural article titled “Creating RESTful Web Services with Windows Communication Foundation” is up at developer.com. Go give it a read, if you dare! I recently spent quite a while digging into the REST implementation in WCF 3.5 (Beta 2): WebGet/WebInvoke, WebOperationContext, WebServiceHost and their ilk. It’s some pretty interesting stuff.

Feel free to make jabs comments on my article here or on the developer.com website… I welcome all feedback! Got questions? I’m happy to answer anything I can, and help research the stuff I can’t.

For the article I put together a working (simple) blog engine service, which was fun. You can download the source on the last page of the article. I got to play around with a glimpse into what LINQ can do–powerfull stuff. Phil Haack was right, implementing a blog engine really is today’s “Hello World”.

Technorati tags: , ,

This entry was posted on Tuesday, August 21st, 2007 at 2:43 pm and is filed under rest, wcf. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Responses to “Creating RESTful Web Services with WCF 3.5”

  1. Scott Says:

    Excellent article, good job.

  2. Matt Says:

    Hi Aaron,
    Great Article, I downloaded the code and tried to get it running on my machine, but it requires IIS. Is there anyway to host the restful service using the built in cassini web server instead of IIS?

  3. aaron Says:

    Thanks Matt!

    If you look under the BlogService solution in the code download, you’ll see a “BlogServiceServer” project. Building and running that project will host the service in a console application – just keep it running and point your browser at the URL that the console window displays.

    Let me know if you run into any problems…

  4. Matt Says:

    I wasn’t running into any problems hosting the service in a console app. Its trying to host it on Cassini that’s giving me a bunch of issues. Its apparently a known issue fixed in RTM.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1963941&SiteID=1

    I was able to get around this issue by specifying the WebHttp endpoint, but now the next issue is trying to get Custom Validation to work with a webHttpBinding. I cant see to get WCF to call my validate function. Have you had any success in getting custom validation to work with webhttpbinding?

  5. Ravi Says:

    Great REST code, is there way to add a JSONP to the output response?

  6. Unifying Web "Sites" and Web Services with the ASP.NET MVC Framework - Aaron Lerch Says:

    [...] services for machines? I can create an ASP.NET site, a SOAP-based ASMX web service, or a SOAP or REST (with .NET 3.5) WCF service and while they can share business logic, there’s still a lot of "endpoint [...]

  7. Ed Swindelles Says:

    So much better than SOAP! I’ve been doing REST with ASP.NET using HTTP Handlers, which I like for the extreme flexibility it provides. I blogged about it here:
    http://www.swindelles.com/ed/2008/07/11/creating-rest-web-services-in-c-sharp/

Leave a Reply