System.Reflection.Emit to Implement a WebChannelFactory for Silverlight 4?-Collection of common programming errors

This question follows upon someone else’s question because the asker never accepted or said the solution to his problem, if he found one.

What’s the most portable way to make a Silverlight & Regular .NET REST client

If you’re familiar with WebChannelFactory from .NET, it provides a clean way to create a client to access WCF Web Http (REST) services. There is no such class in Silverlight 4, so it might be worth creating a class that acts like it.

How would you get started in creating such as class, that creates a client that implements your service’s contract (TChannel)? I don’t know how Microsoft did this, but it looks like they somehow create a new Type at runtime to implement the interface. Would you approach doing this in Silverilght? Maybe by looking at System.Reflection.Emit and TypeBuilder.AddInterfaceImplementation?

A more specific-to-System.Reflection.Emit question I have is, what’s the simplest way to use MethodBuilder to create a method for your TypeBuilder, if you want to use existing compiled code? It looks like you could use MethodBuilder.CreateMethodBody, however, in Silverlight 4 this does not exist.