473,508 Members | 3,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1746
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
4402
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
9958
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
4179
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
11212
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
679
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
4001
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
789
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
14031
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
3086
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
8139
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...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.