Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:10:58+00:00 2026-06-03T05:10:58+00:00

I am doing task of loading the live xml file (from live url) to

  • 0

I am doing task of loading the live xml file (from live url) to XmlDataDocument, but every time I am getting error:

The operation has timed out

The code is as follows, The url containing the xml feeds , I want to load it into xmlDoc.

XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.Load("http://www.globalgear.com.au/productfeed.xml");

Please suggest any solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:11:00+00:00Added an answer on June 3, 2026 at 5:11 am

    Don’t use the Load method of the XmlDataDocument class directly; you have little to no way of influencing the behaviour when it comes to long running HTTP requests.

    Instead, use the HttpWebRequest and HttpWebResponse classes to do the work for you, and then load the subsequent response into your document.

    For example:

        HttpWebRequest rq = WebRequest.Create("http://www.globalgear.com.au/productfeed.xml") as HttpWebRequest;
        //60 Second Timeout
        rq.Timeout = 60000;
        //Also note you can set the Proxy property here if required; sometimes it is, especially if you are behind a firewall - rq.Proxy = new WebProxy("proxy_address");
        HttpWebResponse response = rq.GetResponse() as HttpWebResponse;
    
    
        XmlTextReader reader = new XmlTextReader(response.GetResponseStream());
    
        XmlDocument doc = new XmlDocument();
        doc.Load(reader);
    

    I’ve tested this code in a local app instance and the XmlDocument is populated with the data from your URL.

    You can also substitute in XmlDataDocument for XmlDocument in the example above – I prefer to use XmlDocument as it’s not (yet) marked as obsolete.

    I’ve wrapped this in a function for you:

    public XmlDocument GetDataFromUrl(string url)
    {
        XmlDocument urlData = new XmlDocument();
        HttpWebRequest rq = (HttpWebRequest)WebRequest.Create(url);
    
        rq.Timeout = 60000;
    
        HttpWebResponse response = rq.GetResponse() as HttpWebResponse;
    
        using (Stream responseStream = response.GetResponseStream())
        {
            XmlTextReader reader = new XmlTextReader(responseStream);
            urlData.Load(reader);
        }
    
        return urlData;
    
    }
    

    Simply call using:

    XmlDocument document = GetDataFromUrl("http://www.globalgear.com.au/productfeed.xml");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having difficulty doing this seemingly simple task. I want to load XML files
I'm doing a windows form and would like an audit task to happen every
The trivial task became really time consuming for me. I am doing really basic
I'm currently doing a task where I'm taking forms from a local government body,
I am doing the task of importing xls file to sql server 2008 using
I have been trying to use a .gif file from my resources, but I
I have collection of TimeSpans, they represent time spent doing a task. Now I
I've been given the task of doing some work customizing an artist's space in
I was given the task of doing a facelift to our current site. I
we're transitioning to doing all our task tracking in TFS 2010 and I'm wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.