Unable to read data from the transport connection

Discussion in 'ASP .Net' started by =?Utf-8?B?S2VpdGggQXZlcnk=?=, Oct 12, 2005.

  1. 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();
     
    =?Utf-8?B?S2VpdGggQXZlcnk=?=, Oct 12, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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();
    >
     
    Alvin Bruney - ASP.NET MVP, Oct 12, 2005
    #2
    1. Advertising

  3. 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
    > -------------------------------------------------------
     
    =?Utf-8?B?S2VpdGggQXZlcnk=?=, Dec 30, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mentalis
    Replies:
    0
    Views:
    5,311
    Mentalis
    Jul 12, 2006
  2. Replies:
    4
    Views:
    27,839
    karlitros
    Jul 5, 2007
  3. Jay Balapa
    Replies:
    7
    Views:
    3,114
  4. ninjamonkey
    Replies:
    4
    Views:
    795
    ninjamonkey
    Sep 11, 2007
  5. abhishek
    Replies:
    0
    Views:
    318
    abhishek
    Aug 11, 2008
Loading...

Share This Page