www.webdeveloper.com
Results 1 to 3 of 3

Thread: How do i reduce xml file reading time ???

  1. #1
    Join Date
    Jun 2012
    Posts
    1

    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();
    try
    {
    String URL ="https://125.214.169.85/gmlc/legacy?classID=web_engine_v2&methodID=Handler&username=abc&password=1234ff&clientcode=ABB&phoneno=77 7733773"

    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);
    doc.Load(reader);




    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;
    }

  2. #2
    Join Date
    Jul 2012
    Posts
    2
    Using a binary XML format generally reduces the verbosity of XML ... of reduced file size, without the advantage of decreased parsing time or random access.

  3. #3
    Join Date
    Jul 2012
    Posts
    2

    Post

    Google sitemaps is a protocol that is an XML based system which helps Google crawl your site. It is seen as being one of the best ways...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles