title: How to publish my Rest Web service over IIS (Some thing wrong with my Web.Config file)
body: <p>I have 3 projects in my RESTService.Lib
  They are as follows (this image also contains my xml):
  <a href="https://i.stack.imgur.com/yZdMh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZdMh.png" alt="Visual Studio"></a></p>
  
  <p>My RESTDemoServices.cs contains this code which works fine:</p>
  
  <pre><code>namespace RESTService.Lib
  {
      [ServiceContract(Name = "RESTDemoServices")]
      public interface IRESTDemoServices
      {
          [OperationContract]
          [WebGet(UriTemplate = "/Client/{id}", BodyStyle = WebMessageBodyStyle.Bare)]
          string GetClientNameById(string Id);
      }
  
      [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, IncludeExceptionDetailInFaults = true)]
      [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
      public class RestDemoServices:IRESTDemoServices
      {
          public string GetClientNameById(string Id)
          {
              return ("Le nom de client est Jack et id est : " +Id );
          }
      }
  }
  </code></pre>
  
  <p>And Program.cs in RESTService.Host contains code which is:</p>
  
  <pre><code>namespace RESTService.Host
  {
      class Program
      {
          static void Main(string[] args)
          {
              RestDemoServices DemoServices = new RestDemoServices();
              WebHttpBinding binding = new WebHttpBinding();
              WebHttpBehavior behavior = new WebHttpBehavior();
  
              WebServiceHost _serviceHost = new WebServiceHost(DemoServices, new Uri("http://localhost:8000/DEMOService/"));
              _serviceHost.AddServiceEndpoint(typeof(IRESTDemoServices), binding, "");
              _serviceHost.Open();
              Console.ReadKey();
              _serviceHost.Close();
          }
      }
  }
  </code></pre>
  
  <p>And Web.Config contains the code:</p>
  
  <pre><code> &lt;?xml version="1.0"?&gt;
  
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    --&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;behaviors&gt;
              &lt;serviceBehaviors&gt;
                  &lt;behavior name="svcBehavior"&gt;
                      &lt;serviceMetadata httpGetEnabled="true" /&gt;
                      &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
                  &lt;/behavior&gt;
              &lt;/serviceBehaviors&gt;
          &lt;/behaviors&gt;
        &lt;bindings&gt;
          &lt;webHttpBinding&gt;
            &lt;binding&gt;
              &lt;security mode="Transport"/&gt;
            &lt;/binding&gt;
          &lt;/webHttpBinding&gt;
        &lt;/bindings&gt;
        &lt;services&gt;
          &lt;service name="RestService.WebHost" behaviorConfiguration="svcBehavior"&gt;
            &lt;endpoint  name="" binding="WebHttpBinding" address="soap" contract="RESTDemoServices.IRESTDemoServices" /&gt;
          &lt;/service&gt;
        &lt;/services&gt;
  
          &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Why am I not able to get it to publish on IIS?<br>
  The code works fine when I create a client and consume it.  Perhaps the problem is in Web.Config, but could someone please point out what is the problem there?  </p>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>403.14 - The web server is configured to not list the contents of this directory.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/1OCmS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1OCmS.png" alt="Error screen"></a>                                </p>