473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unable to read data from the transport connection

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
2 1742
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
0
by: Steve - DND | last post by:
We are continually receiving timeout, and "Unable to write data to the transport connection" errors while using the System.Net.HttpWebRequest class from an ASP.Net web page. Below are the two...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
0
by: Aryeh Holzer | last post by:
Hi, I've been trying to use the weather webservice available from the National Weather Service (NWS), at http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML. wsdl without success. Here's...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
1
by: Terrance | last post by:
I'm trying to create a small messenger program that uses the tcpclient and tcplistenter objects. When I start the application and run the thread that fires the tcplistener; once the client sends...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
7
by: Jay Balapa | last post by:
Hello, We have a Pocket PC client application which just connects to our webservice. When a client connects his Pocket PC through his WIFI he gets the following- Unable to read data from the...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.