title: Unable to connect to self-hosted WCF service
body: <p>I am trying to build a fairly basic WCF SOAP web service self-hosted as a Windows service. The Windows service itself is up and running on my machine -- I just can't access it locally via Visual Studio or the web browser.</p>
  
  <p>The relevant C# code is below. Assume <code>MyDummyService</code> implements contract <code>IDummyService</code>:</p>
  
  <pre><code>public class Program : ServiceBase
  {
      private ServiceHost host = null;
      private readonly Uri baseAddress = new Uri("http://localhost:8000/DummyAPI");
  
      public static readonly ILog log = LogManager.GetLogger(typeof(Program));
      /// &lt;summary&gt;
      /// The main entry point for the application.
      /// &lt;/summary&gt;
      public static void Main(string[] args)
      {
          ServiceBase.Run(new Program());
      }
  
      public Program()
      {
          this.ServiceName = "DummyService";
      }
  
      protected override void OnStart(string[] args)
      {
          log.Info("Starting service");
  
          try
          {
              base.OnStart(args);
  
              host = new ServiceHost(typeof(MyDummyService), baseAddress);
  
              host.Open();
          }
          catch (Exception ex)
          {
              log.Error(ex.ToString());
          }
          finally
          {
              if (host != null)
                  ((IDisposable)host).Dispose();
          }
      }
  
      protected override void OnStop()
      {
          log.Info("Stopping service");
          base.OnStop();
          host.Close();
      }
  }
  </code></pre>
  
  <p>The relevant <code>app.config</code>:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
          &lt;service name="DummyAPI.MyDummyService" 
                   behaviorConfiguration="MyDummyBehavior"&gt;
             &lt;endpoint 
                 address="" 
                 binding="basicHttpBinding" 
                 contract="DummyAPI.IDummyService" /&gt;
             &lt;endpoint address="mex" binding="mexHttpBinding" 
                       contract="IMetadataExchange" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="MyDummyBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="True" policyVersion="Policy15"/&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="True"/&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>When I access</p>
  
  <pre><code>http://localhost:8000/DummyAPI
  </code></pre>
  
  <p>or</p>
  
  <pre><code>http://localhost:8000/DummyAPI/MyDummyService
  </code></pre>
  
  <p>(or either of those followed by ?wsdl) in the web browser, I get a 404. The obvious first question: what did I botch above?</p>
  
  <p>The <code>web.config</code> namespaces (or what look like namespaces) have me a little confused. What can I safely make up on the spot, and what needs to reflect C# class namespaces?</p>