I've an ASP.NET MVC project, where I use the WCF Web Api (Preview 6), and I want to use this to support a simple JSON service that supports JSONP. The JSON part of the service I got up and running pretty easy, but I've got some problems with the JSONP part of it.
Based on Alexander Zeitler's excellent post, I got the idea to use a Response Handler to support JSONP with the callback parameter, but I can figure out how to add this response handler to the HttpConfiguration (with WCF Web Api Preview 6).
My code in Global.ascx.cs looks something like this:
var catalog = new AssemblyCatalog(typeof(MvcApplication).Assembly);
var container = new CompositionContainer(catalog);
var config = new HttpConfiguration() { EnableTestClient = true };
config.MessageHandlerFactory = () => container.GetExportedValues<DelegatingHandler>();
//config.ResponseHandlers <-- what to do here???
The message handler factory takes care of explicitly returning a JSON requests when using the /json in the URL.