I'm looking to implement something similar to the way JSONP callbacks work with WCF in .NET 4. If you pass a callback parameter it wraps the response without callback needing to be in your method signature. What I w开发者_开发问答ant to do is have an attribute that switches the response format if a parameter named format is passed. I want it to not require the format parameter in the method signature.
Anyone have a starting point suggestion, doubts of possibility, tips?
You'll need a couple of components to implement the response wrapping. JSONP support was added to WCF on .NET Framework 4.0, before that there was a sample which showed how it can be implemented, so you can look at that to see what you need to do. You can find the sample at http://msdn.microsoft.com/en-us/library/cc716898.aspx.
精彩评论