Unable to read data from the transport connection

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();
 
A

Alvin Bruney - ASP.NET MVP

what is the exact error message and stack dump?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
G

Guest

Hi Alvin

A belated reply to say we tracked down the problem. Your response
highlighted the fact that we weren't making use of all the debug information.

It turned out to be a timeout problem with the ASP page that was being called.

Happy New Year
Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top