By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,696 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,696 IT Pros & Developers. It's quick & easy.

Unable to read data from the transport connection

P: n/a
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();

Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
-------------------------------------------------------

"Keith Avery" <Ke********@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
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();

Nov 19 '05 #2

P: n/a
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

"Alvin Bruney - ASP.NET MVP" wrote:
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
-------------------------------------------------------


Dec 30 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.