I am getting followed error while first time get report on different server afterwards i refresh web page again report appearing properly.What can be cause?
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.6.240.151:80
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
try
{
if (Request.QueryString.Keys.Count == 0)
Response.End();
else
{
string uri = ConfigurationSettings.AppSettings["uri"] + Request.QueryString;
WebRequest request = WebRequest.Create(uri);
WebResponse responses = request.GetResponse();
byte[] response = new System.Net.WebClient().DownloadData(uri);
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", responses.Headers.GetValues(2)[0]);
Response.BinaryWrite(response);
Response.Flush();
Response.End();
}
}
catch {
throw exception;
}
}
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="uri" value="http://test.domain.com/report/?" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.net>
<defaultProxy>
<proxy proxyaddress = "http://10.6.240.151:80" bypassonlocal = "True" />
</defaultProxy>
</system.net>
</configuration>