I am developing an application in which I am reading data from xml feed.The xml feed contains large amount of data, which near about 100MB. So while reading data from feed session time out occurs in between.
Can any one suggest me how could I avoid time out.
I have also tried extending execution time out and request length but still the issue is not resolved.
<httpRuntime executionTimeout="100000000" maxRequestLength="2097151"
useFullyQualifiedRedirectUrl="false" minFreeThreads="8"
minLocalRequestFreeThreads="4" appRequestQueueLimit="100"
enableVersionHeader="true" />
Code to read xml data from URL:
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sUrl);
HttpWebResponse wr = (HttpWebResponse)wrGETURL.GetResponse();
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
if (wr.StatusCode == HttpStatusCode.OK)
{
Stream resStream = wr.GetResponseStream();
string tempString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Encoding.ASCII.GetString(buf, 0, count);
sb.Append(tempString);
}
}
}