title: WCF Json GET Service: Check that the sender and receiver's EndpointAddresses agree
body: <p>I've been working in .NET for a while now, but I'm new to WCF. I'm trying to create my very first WCF service using JSON. I thought I would start really, really simple and then build from there.  But I have somehow managed to screw up even the most simple of services. Here's what I've got so far.</p>
  
  <p>Web.Config:</p>
  
  <pre><code>   &lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="MarathonInfo.MarathonInfoService"&gt;
          &lt;endpoint address="http://localhost:10298/MarathonInfoService.svc" binding="webHttpBinding" contract="MarathonInfo.IMarathonInfo" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="false" /&gt;
    &lt;/system.serviceModel&gt;
   &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Then, in the service file:</p>
  
  <pre><code>namespace MarathonInfo
  {
      public class MarathonInfoService : IMarathonInfo
      {
          public String GetData()
          {
              return "Hello World";
          }
      }
  }
  </code></pre>
  
  <p>And in the interface:</p>
  
  <pre><code>namespace MarathonInfo
  {
      [ServiceContract]
      public interface IMarathonInfo
      {
  
          [OperationContract]
          [WebInvoke(Method = "GET", UriTemplate = "/GetData", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
          String GetData();
      }
  }
  </code></pre>
  
  <p>So, when I go to this url:</p>
  
  <pre><code>http://localhost:10298/MarathonInfoService.svc/GetData
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>The message with To
    'http://localhost:10298/MarathonInfoService.svc/GetData' cannot be
    processed at the receiver, due to an AddressFilter mismatch at the
    EndpointDispatcher.  Check that the sender and receiver's
    EndpointAddresses agree.</p>
  </blockquote>
  
  <p>I am able to execute the service just fine through Visual Studio in debug mode. But in the browser, I only get that error.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks!</p>
  
  <p>Casey</p>