I working on a REST service based on the 'WCF REST Service template' in VS2010. Out-of-the-box, you can have a service return XML or JSON, based on the Accept type specified in the request, but how do I add my own format.... I found an example:
http://msdn.microsoft.com/en-us/library/ee476510.aspx
where you test the Accept header in the method, and return Message based on that type, however I don't really like to implement this in all my service methods.
What I'd really like is a way where I could annotate (attribute) my DataContract with a formatter/serializer for each kind of Content-Type that I want to support, and then framework call my formatter/serialiser when asked for a Content-Type not supported out-of-the-box.
Are there already some extensionpoints, in the WCF REST Service framework, for doing this??
Any help would be greatly appreciated TIA
Søren