One of the things people often complain about when building REST clients is the lack of proxy generation support. Although to be fair, it's usually only heard from those coming from a SOAP/WSDL background (some would argue it's completely unnecessary). Achieving this typically requires support for a metadata language like WADL or WSDL 2.0, which are not yet widely supported nor considered standards.

The WCF REST Starter Kit Preview 2 provides a nice solution to this dilemma for .NET developers.  They provide a new HttpClient API that provides generic support for the uniform HTTP interface (Get, Post, Put, Delete, Head, etc) that can be used to process a variety of common resource representations like XML/XHTML, JSON, Atom/AtomPub, binary streams, etc. And when using XML/JSON, you can tell it to use an XmlSerializer or DataContractSerialzier type, which gives you the dot-notation experience that you might long for while writing .NET clients.

The only problem is how do you get the serializable types to use with HttpClient?  If the REST service provides an XSD schema, you can always use xsd.exe or svcutil.exe to generate the appropriate serializable types. But many REST services don't provide schema definitions. In this case, you'd typically be forced to write the serializable types by hand by inspecting the documentation or XML instances while using the service (very common). Hence, the WCF REST Starter Kit Preview 2 provides another new feature for this specific scenario: Paste XML as Types.


You simply copy a sample XML instance for the resource in question into your clipboard, and then select "Paste XML as Types" from the Visual Studio Edit menu. The plug-in will then generate a set of XmlSerializer types capable of processing the XML instance you pasted. You'll still probably want to tweak the generated class definitions to some degree, but this feature can definitely speed up the process for this use case.

Watch this screencast on building a Twitter read/write client in under 3 minutes to see this feature in action.