Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Thanked 0 Times in 0 Posts

    How do i reduce xml file reading time ???

    I used following code to access a service hosted in https. The out put I need to process is a xml document which takes too much time (30 seconds) after application being idle for more than 10 minutes. Please Help me finding the issue with this.
          public LBSLocation GetLBSLocationInfo(string mobileNo)
                LBSLocation location = new LBSLocation();
                    String URL =""
                    XmlDocument doc = new XmlDocument();
                    HttpWebRequest rq = (HttpWebRequest)WebRequest.Create(URL);
                    System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(RemoteCertificateValidationCallback);
                    HttpWebResponse response = rq.GetResponse() as HttpWebResponse;
                    using (Stream responseStream = response.GetResponseStream())
                        XmlTextReader reader = new XmlTextReader(responseStream);
                        XmlNodeList nodeList = doc.GetElementsByTagName("location");
                        for (int i = 0; i < nodeList.Count; i++)
                            XmlNode n = (XmlNode)nodeList[i];
                            location.Latitude = n.ChildNodes[0].InnerText;
                            location.Longitude = n.ChildNodes[1].InnerText;
                            location.LocationName = n.ChildNodes[2].InnerText;
                    return location;
                catch (Exception ex)
                    throw ex;
            public static bool RemoteCertificateValidationCallback(object sender, X509Certificate certificate,
                                               X509Chain chain, SslPolicyErrors errors)
                return true;
    Last edited by Alex Vincent; 06-22-2012 at 06:03 PM. Reason: adding code tags

  2. #2
    Join Date
    May 2002
    Hayward, CA
    Thanked 24 Times in 22 Posts
    * What language is that script written in?
    * How big is your XML document?
    * Your HTTPS certificate is failing. Why?
    * Do you have extra whitespace that might be slowing down processing?
    * Are you using gzip compression in your HTTP download?
    * Does your user need every single bit of that information immediately? (Pagination might help.)
    * Why are you passing the username and password in the query string?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES7-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts