title: WCF Service Base Address vs endpoint address
body: <p>What's the difference between the following two cases:</p>
  
  <p><strong>Configuration 1:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;service name="WcfService1.Service1" behaviorConfiguration="MyServiceTypeBehaviors"&gt;
      &lt;host&gt;
          &lt;baseAddresses&gt;
              &lt;add baseAddress="net.tcp://127.0.0.1:808/" /&gt;
          &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint address="service"
                binding="netTcpBinding" 
                bindingConfiguration="MainBinding" 
                bindingName="MainBinding" 
                name="DefaultEndpoint" 
                contract="WcfService1.IService1" /&gt;
      &lt;endpoint address="mex" 
                binding="mexTcpBinding" 
                contract="IMetadataExchange" /&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p><strong>Configuration 2:</strong>
  </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;service name="WcfService1.Service1" behaviorConfiguration="MyServiceTypeBehaviors"&gt;
      &lt;host&gt;
          &lt;baseAddresses&gt;
              &lt;add baseAddress="net.tcp://127.0.0.1:808/service" /&gt;
          &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint address="net.tcp://127.0.0.1:808/service" 
                binding="netTcpBinding" 
                bindingConfiguration="MainBinding" 
                bindingName="MainBinding" 
                name="DefaultEndpoint" 
                contract="WcfService1.IService1" /&gt;
      &lt;endpoint address="mex" 
                binding="mexTcpBinding" 
                contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  </code></pre>
  
  <p>What I understand is In either case <strong>base address + endpoint address</strong> resolves to same <strong>absolute address</strong></p>
  
  <p>But why I get the error on <strong>Configuration 2</strong> : <em>"No end point is listening at net.tcp://127.0.0.1:808/</em><br>
  but <strong>Configuration 1</strong> <em>runs the service without any errors</em>!!!</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p><strong>Working Config:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;host&gt;
      &lt;baseAddresses&gt;
          &lt;add baseAddress="net.tcp://127.0.0.1:808/" /&gt;
      &lt;/baseAddresses&gt;
  &lt;/host&gt;
  &lt;endpoint address="service"
            binding="netTcpBinding" 
            bindingConfiguration="MainBinding" 
            bindingName="MainBinding" 
            name="DefaultEndpoint" 
            contract="WcfService1.IService1" /&gt;
  </code></pre>
  
  <p>Non working Config:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;host&gt;
      &lt;!--
      &lt;baseAddresses&gt;
          &lt;add baseAddress="" /&gt;
      &lt;/baseAddresses&gt;
      --&gt;
   &lt;/host&gt;
   &lt;endpoint address="net.tcp://127.0.0.1:808/service"
             binding="netTcpBinding" 
             bindingConfiguration="MainBinding" 
             bindingName="MainBinding" 
             name="DefaultEndpoint" 
             contract="WcfService1.IService1" /&gt;
   &lt;endpoint address="mex" 
             binding="mexTcpBinding" 
             contract="IMetadataExchange" /&gt;
  </code></pre>
  
  <p>In this case, I have removed base address and provided complete service address (with out .svc path) but get a socket time out error. What's wrong in this case? Does the end point address always need the complete address with .svc when base address is not defined? If so, what could be the reason behind?</p>