title: Why do I see "HTTP Error 400. The request hostname is invalid." when connected to a wcf service
body: <p>Good day, help me, please understand the situation:</p>
  
  <p>connect to the wcf service is only obtained locally</p>
  
  <pre><code>http://localhost:50233/Service1.svc?wsdl
  </code></pre>
  
  <p>when tested compound from another machine on the LAN i see the error 400</p>
  
  <pre><code>http://computer:50233/Service1.svc?wsdl
  </code></pre>
  
  <p>i Found information that this may be due to MaxFieldLength and therefore i edited registry as advised here, but it does not alter the result.</p>
  
  <pre><code>C: \ Users \ user&gt; ping computer
  
  Pinging 192.168.0.11 with 32 bytes of data:
  
  Reply from 192.168.0.11: bytes = 32 time &lt;1ms TTL = 127
  
  Reply from 192.168.0.11: bytes = 32 time &lt;1ms TTL = 127
  
  Reply from 192.168.0.11: bytes = 32 time &lt;1ms TTL = 127
  
  Reply from 192.168.0.11: bytes = 32 time &lt;1ms TTL = 127
  
  Ping statistics for 192.168.0.11:
  
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
  
  Approximate round trip times in milli-seconds:
  
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
  </code></pre>
  
  <p>When you stop service  the error on the remote computer is changed to</p>
  
  <pre><code>"Web page not available"
  </code></pre>
  
  <p>The rules of the firewall allows all incoming connections on port 50233.</p>
  
  <p>When connecting to a local address</p>
  
  <pre><code>http://computer:50233/Service1.svc?wsdl
  </code></pre>
  
  <p>i See the same error 400.</p>
  
  <p>when removing or replacing the "localhost" on IP</p>
  
  <pre><code>&lt;binding protocol="http" bindingInformation="*:50233:localhost" /&gt;
  </code></pre>
  
  <p>File \ My Documents \ IISExpress \ config \ applicationhost.config</p>
  
  <p>connection becomes not available.</p>
  
  <p>When you add another Binding</p>
  
  <pre><code>&lt;Binding Protocol="http" bindingInformation="*:50233:localhost" /&gt;
  
  &lt;Binding Protocol="http" bindingInformation="*:50233:192.168.0.11" /&gt;
  </code></pre>
  
  <p>service when trying to start swears Program "[9632] iisexpress.exe"</p>
  
  <p>failed with code -1073741816 (0xc0000008) 'An invalid handle was specified'.</p>
  
  <p>Windows 8, Visual Studio 2013, use the built-IIS Express, both computers are in the same domain.</p>