Thread was being aborted
Hi,
i am calling a URL for getting an XML data. I am using HTTPWEBRequest object for getting the data but i am getting an error as "Thread was being aborted.System at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.StreamReader.ReadBuffer() at System.IO.StreamReader.ReadToEnd()".
I am using following code for calling the page.
private string Connect(string webUrl)
{
string strResp;
try
{
ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(webUrl);
httpReq.Timeout = 360000;
HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();
StreamReader strmRead = new StreamReader(httpRes.GetResponseStream());
strResp = strmRead.ReadToEnd();
strmRead.Close();
}
catch(Exception e)
{
string strError=e.Message+"~"+e.Source+"~"+e.StackTrace;
}
return (strResp);
}
can anybody suggest solution for this problem.
Thanks in advance
Ajay
|