title: Return JSON from self-hosted WCF 4.5 service?
body: <p>How do I get JSON from a self-hosted WCF 4.5 service?</p>
  
  <p>I'm using Fiddler2 to send requests with "Content-Type: application/json" (also tried "Content-Type: application/javascript") but I keep getting XML.</p>
  
  <p>In combination with setting "AutomaticFormatSelectionEnabled = true" on my WebHttpBehavior I still get XML and when using "Content-Type: application/json" the server won't respond at all (Then I get error 103)</p>
  
  <p>I have enabled CrossDomainScriptAccessEnabled on my WebHttpBinding and I'm using a WebServiceHost in a console host.</p>
  
  <p>The service is very simple:</p>
  
  <pre><code>[ServiceContract]
  public interface IWebApp
  {
    [OperationContract, WebGet(UriTemplate = "/notes/{id}")]
    Note GetNoteById(string id);
  }
  </code></pre>
  
  <p>I've also tried setting AutomaticFormatSelectionEnabled to false and using ResponseFormat = WebMessageFormat.Json in my service-contract but that also result in "error 103" with no further info.</p>
  
  <p>I've turned of customErrors and set FaultExceptionEnabled, HelpEnabled to true (not sure if that would do anything about this but just to make sure I've tried it all)</p>
  
  <p>Am I missing a dll or something else?</p>