title: Can't Run WCF methods from a browser
body: <p>I created a simple WCF service application, and try to change the WCF code, that it will also be able to be called from a client browser, but it only successfully runs from a WCF client. </p>
  
  <p>running from browser, doesn't call the WCF service (but no error message in browser).</p>
  
  <p>code:</p>
  
  <p>Contract:</p>
  
  <pre><code>[ServiceContract]
  public interface IService1
  {
      [OperationContract]
      [WebGet] 
      string Test();
  
      [OperationContract]
      [WebGet] 
      string GetData(int value);
  }
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>public class Service1 : IService1
  {
      public string GetData(int value)
      {
          return string.Format("You entered: {0}", value);
      }
  
      public string Test()
      {
          return "test success";
      }
  }
  </code></pre>
  
  <p>Web.config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.5" /&gt;
      &lt;httpRuntime targetFramework="4.5"/&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;protocolMapping&gt;
          &lt;add binding="webHttpBinding" scheme="https" /&gt;
      &lt;/protocolMapping&gt;    
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
      &lt;directoryBrowse enabled="true"/&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Project URL:</p>
  
  <pre><code>http://localhost:1507/
  </code></pre>
  
  <p>browser URL line - test method:</p>
  
  <pre><code>http://localhost:1507/Service1.svc/Test
  </code></pre>
  
  <p>Thanks.</p>