title: RESTful WCF service that can respond in both JSON(P) and XML and still be used as SOAP web service?
body: <p>Given a contract such as:</p>
  
  <pre><code>[ServiceContract] public interface IService
  {
      [OperationContract]
      [WebGet(UriTemplate = "GetData/{id}.{format}")]
      ResponseData GetData(string id, string format);
  }
  </code></pre>
  
  <p>Is there a way to get the service to respond with json when requested as:
  /GetData/1234.json, xml when requested as /GetData/1234.xml and still be available as a proper soap service at some other url, with a strongly typed wsdl contract?</p>
  
  <p>Using a Stream as the return value for GetData is not workable, as though it fufills the first two requirements, wcf can't create a full wsdl specification as it has no idea what the contents of the resultant Stream will be.</p>