Windows Communication Foundation (WCF)

This series of posts about creating RESTful services using WCF is by far the most popular topic on my blog. Since it was first published, the single post “Creating RESTful WCF Web Services Using Visual Studio 2010” has received the largest number of views (35% of all hits so far) and is consistently the top hit of the day. Ironically, WCF was not my topic of interest when I started this series. My main focus was creating a web service that met Dr. Fielding’s definition of REST.1 Visual Studio and WCF were simply the most familiar tools I had when working through examples in Leonard Richardson’s and Sam Ruby’s book “RESTful Web Services”.2 Although the final WCF web service has been upgraded to VS 2013 and .NET 4.0 – and is now being rewritten using Web API 2.0 – I hope the information in this series will continue to help anyone who needs to maintain or migrate a VS 2010 WCF RESTful web service.

Download sample project from GitHub

  • WCF – Visual Studio 2010 REST Web Service Project Download Since I’ve had a few requests for a download of a Visual Studio project for a WCF REST web service, here’s a a working project that incorporates all the WCF and most of the REST tips from my blog to date. RESTFUL WCF Demo Please see my “About” page for copyright and disclaimer information when ...
  • WCF – Including XML Attributes in Your DataContract RESTful web services must include hypertext within their resource representations to fulfill the HATEOAS constraint.1 XML attributes within a <link> element have become a standard part of this hypertext. The Atom Publishing Protocol is considered to be quite RESTful2 and defines several attributes for a <link>. This Atom <links> has “rel” and “href” attributes that ...
  • WCF – Removing .svc from RESTful URIs Addressability is one of the four properties of Resource-Oriented Architectures. An application is addressable if it exposes the interesting aspects of its data set through resources. And resources are exposed through their unique URIs.1 By default, the endpoints of an IIS hosted WCF service have the service file name in their URLs.2 For example, http://www.mydomain.com/Service1.svc/resource1 While not ...
  • WCF- Changing Data Contract Names and Namespaces When posting XML data to a Windows Communication Foundation (WCF) web service1, you need to specify the XML namespace of the data sent in the entity-body of your HTTP POST. This lets WCF know how to deserialize the input you’ve sent. By default, WCF maps the namespace to: http://schemas.datacontract.org/2004/07/Clr.Namespace where Clr.Namespace is the namespace of your data ...
  • Creating RESTful WCF Web Services Using Visual Studio 2010 Representational State Transfer (REST) is an architectural style used to build distributed systems. First proposed in 2000 by Roy Thomas Fielding in his doctoral dissertation “Architectural Styles and the Design of Network-based Software Architectures”, REST is now, or will soon be, the predominant architecture for building web services. However, there’s a lot of discussion about ...

1. Fielding, Roy Thomas. Architectural Styles and the Design of Network-based Software Architectures. Doctoral dissertation, University of California, Irvine, 2000.

2. Richardson, Leonard and Ruby, Sam. RESTful Web Services. Sebastopol: O’Reilly Media, Inc., 2008. Ebook