title: Browser connects to WCF service but not my WCF client. What can be the reason?
body: <p>On a production server (Windows Server 2003 SP2) I can connect to a remote WCF service with Internet Explorer 8: When I browse to the URL <a href="http://www.domain.com/Service.svc" rel="nofollow noreferrer">http://www.domain.com/Service.svc</a> (where my service listens) I get the expected info page of the service displayed. Connection settings in Internet Explorer only specify "auto detect", proxy settings are disabled.</p>
  
  <p>If I start a console application (built with WCF in .NET 4.0) on the same server which also tries to connect to the same WCF service it fails telling me that no endpoint was available listening on <a href="http://www.domain.com/Service.svc" rel="nofollow noreferrer">http://www.domain.com/Service.svc</a>.</p>
  
  <p>Configuration of the WCF client:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              bypassProxyOnLocal="false" transactionFlow="false"
              hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" 
                maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" /&gt;
              &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://www.domain.com/Service.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
            contract="Service.IMyService" name="WSHttpBinding_IMyService" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  &lt;configuration&gt;
  </code></pre>
  
  <p>With these settings I can communicate successfully with the remote service from my development machine.</p>
  
  <p>Looking around for other options I found that I can specify to use the Internet Explorer proxy settings with:</p>
  
  <pre><code>&lt;system.net&gt;
    &lt;defaultProxy&gt;
      &lt;proxy usesystemdefault="true" /&gt;
    &lt;/defaultProxy&gt;
  &lt;/system.net&gt;
  </code></pre>
  
  <p>It didn't work and I am not sure if I understood this setting really correctly. (My hope was that the WCF client will adopt the "autodetect" setting of Internet Explorer and then connect the same way to the service like the installed IE.)</p>
  
  <p>I also had toggled the <code>useDefaultWebProxy</code> setting in the binding configuration between true and false with no success.</p>
  
  <p>Now I am asking for help what I can do? Which settings might be wrong or missing? What could I test and how can I get more detailed error messages to better identify the problem?</p>
  
  <p>Thank you in advance!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Stack in <code>Innerexception</code> is saying:</p>
  
  <ul>
  <li><strong>System.Net.WebException</strong>: Connection to remote server could not be established</li>
  <li><strong>System.Net.Sockets.SocketException</strong>: Connection failed since the host didn't answer after a certain time span or the connection was faulted since the connected host didn't answer.</li>
  </ul>