I am trying to make a web request from a web page and I am having a problem on a production server.
The web application is an intranet website with this configuration on web.config:
<authentication mode="Windows" />
I use it to get domain user authentication.
Now I'm trying to load a web page to analyze some information, I used the code below, the error appears in the second line:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Error message:
It is not possible to establish a connection because the target machine has actively abandoned it. 64.233.163.104:80.
Stack trace:
[SocketException (0x274d): No connection could be made because the target machine actively refused it 64.233.163.104:80]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +269
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +649
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse() +1126
Fumagalli.Insight.Admin.Teste.Page_Load(Object sender, EventArgs e) +606
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
This error does not occur with all the URLs I tried, I can get a response from www.yahoo.com, but not from www.google.com for example.
(Windows 7) , URL-, ( ), (Windows Server 2008).
- ?