title: Exposing wcf service metadata
body: <p>I'm following a tutorial on setting up a wcf service.  I finished the changes it talks about, up to the first time it says to start the service.  When navigating to the endpoint in my web browser I either get a 404 or 403.14 error.  Initially the service was showing the folder structure, but I removed the attribute in the web.config file that was enabling that.  I'm sure the issue is related to that file, but I'm not sure what else to change. 
  Link to the guide: <a href="http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/four-steps-to-create-first-wcf-service-for-beginners/" rel="nofollow">http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/four-steps-to-create-first-wcf-service-for-beginners/</a></p>
  
  <p>Web.config file:</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.2"/&gt;
      &lt;httpRuntime targetFramework="4.5.2"/&gt;
      &lt;httpModules&gt;
        &lt;add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/&gt;
      &lt;/httpModules&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="WcfCalculator.Calculator" behaviorConfiguration="Metadata"&gt;
          &lt;endpoint address="" contract="WcfCalculator.ICalculator" binding="basicHttpBinding"/&gt;
          &lt;endpoint name="mex" address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="Metadata"&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
          &lt;/behavior&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="true"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;protocolMapping&gt;
          &lt;add binding="basicHttpsBinding" 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;remove name="ApplicationInsightsWebTracking"/&gt;
        &lt;add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
          preCondition="managedHandler"/&gt;
      &lt;/modules&gt;
      &lt;!--
          To browse web app root directory during debugging, set the value below to true.
          Set to false before deployment to avoid disclosing web app folder information.
        --&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Service Contract:</p>
  
  <pre><code>using System.ServiceModel;
  
  namespace WcfCalculator
  {
      [ServiceContract]
      public interface ICalculator
      {
          [OperationContract]
          double AddNumbers(double number1, double number2);
          [OperationContract]
          double SubstractNumbers(double number1, double number2);
          [OperationContract]
          double MultiplyNumbers(double number1, double number2);
          [OperationContract]
          double DivisionNumbers(double number1, double number2);
      }
  }
  </code></pre>