G
Guest
We have an ASP.NET application. This is loading data using XML from another
ASP web site.
It all works fine for small XML data files. For larger XML data file being
streamed from the ASP web site the error "Unable to read data from the
transport connection" is raised midway through the import. It all works fine
on the development server, but not in the live environment.
Anybody have any idea why this is occuring and how to fix it? I'm assuming a
timeout is occuring somewhere.
We are using functionality similar to the following:
public class ProxyXmlUrlResolver : System.Xml.XmlUrlResolver
{
public IWebProxy Proxy = WebProxy.GetDefaultProxy();
public override object GetEntity(Uri absoluteUri, string role, Type
ofObjectToReturn)
{
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(absoluteUri);
req.Proxy = Proxy;
req.Timeout = 3600000;
return req.GetResponse().GetResponseStream();
}
}
================
Uri uri = new Uri (ASPWeBSiteAddress);
ProxyXmlUrlResolver resolver = new ProxyXmlUrlResolver();
NetworkCredential nc = new NetworkCredential
(ProxyUsername,ProxyPassword,ProxyDomain);
if (ProxyEnabled)
{
try
{
resolver.Proxy = new WebProxy(ProxyServerUrl, false, null, nc);
}
catch(Exception e)
{
}
resolver.Credentials = nc;
}
try
{
xmlStream = (Stream)resolver.GetEntity(uri, null, typeof(Stream));
}
catch(Exception e)
{
}
=============
XmlTextReader reader = new XmlTextReader(xmlStream);
while (reader.Read())
{
}
reader.Close();
ASP web site.
It all works fine for small XML data files. For larger XML data file being
streamed from the ASP web site the error "Unable to read data from the
transport connection" is raised midway through the import. It all works fine
on the development server, but not in the live environment.
Anybody have any idea why this is occuring and how to fix it? I'm assuming a
timeout is occuring somewhere.
We are using functionality similar to the following:
public class ProxyXmlUrlResolver : System.Xml.XmlUrlResolver
{
public IWebProxy Proxy = WebProxy.GetDefaultProxy();
public override object GetEntity(Uri absoluteUri, string role, Type
ofObjectToReturn)
{
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(absoluteUri);
req.Proxy = Proxy;
req.Timeout = 3600000;
return req.GetResponse().GetResponseStream();
}
}
================
Uri uri = new Uri (ASPWeBSiteAddress);
ProxyXmlUrlResolver resolver = new ProxyXmlUrlResolver();
NetworkCredential nc = new NetworkCredential
(ProxyUsername,ProxyPassword,ProxyDomain);
if (ProxyEnabled)
{
try
{
resolver.Proxy = new WebProxy(ProxyServerUrl, false, null, nc);
}
catch(Exception e)
{
}
resolver.Credentials = nc;
}
try
{
xmlStream = (Stream)resolver.GetEntity(uri, null, typeof(Stream));
}
catch(Exception e)
{
}
=============
XmlTextReader reader = new XmlTextReader(xmlStream);
while (reader.Read())
{
}
reader.Close();