title: Error 404 When calling Restful Wcf Service
body: <p>I did the search again and again but I don't really know what am I missing.  I have WCF method and after calling, the service return with error 404, resource can not be found.</p>
  
  <p>The url like this: localhost:3522/AccountService.svc/accountbalance/1</p>
  
  <p>I run it from Visual with IIS 8 Express.</p>
  
  <p>The WCF method like this</p>
  
  <pre><code>[ServiceContract]
  public interface IAccountService
  {
      [OperationContract]
      [WebGet(UriTemplate = "accountbalance/{accountId}")]
      decimal GetAccountBalance(string accountId);
  }
  </code></pre>
  
  <p>And this is my web.config</p>
  
  <pre><code>&lt;bindings&gt;
    &lt;/basicHttpBinding&gt;
    &lt;webHttpBinding&gt;
      &lt;binding name="WebHttpBinding"&gt;
        &lt;security mode="Transport"&gt;
          &lt;transport clientCredentialType="Windows" proxyCredentialType="Windows" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  
  &lt;services&gt;
    &lt;service behaviorConfiguration="ProfileServiceDefaultBehavior"
      name="MyWcfService.AccountService"&gt;
      &lt;endpoint behaviorConfiguration="RestFulBehavior" binding="webHttpBinding"
        bindingConfiguration="WebHttpBinding" name="AccountServiceEndpoint"
        bindingName="AccountServiceBinding" contract="MyWcfService.IAccountService" /&gt;
      &lt;endpoint address="mex" behaviorConfiguration="" binding="mexHttpBinding"
        contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  
  &lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="RestFulBehavior"&gt;
        &lt;webHttp automaticFormatSelectionEnabled="true" /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ProfileServiceDefaultBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true" /&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  
  &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
  </code></pre>