title: Why do I get an Unable to connect to the remote server exception from a web app and not console app?
body: <p>I have a asmx web service running on a test server that has anonymous access enabled. </p>
  
  <p>When I add the web reference to a console application and call a simple Hello World method like so:</p>
  
  <pre><code>PivotService.PivotService p = new PivotService.PivotService();
  String s = p.SayHello();
  </code></pre>
  
  <p>When I do exactly the same thing in the page load of a web application I get a <code>System.Net.WebException: {"Unable to connect to the remote server"}</code>. </p>
  
  <p>The inner exception is <code>{"No connection could be made because the target machine actively refused it 127.0.0.1:8888"}</code>, errorCode 10061.</p>
  
  <p>Why would this work from a console app and not a web app?</p>