Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello friends,
in 1 of our project ,we have to create an available domain search box.But we are getting time out error .
This is our code

C#
string sld = txtsearch.Text.Trim();
          // URL for API request
           const string url = "https://kats.supersite.myorderbox.com/api/domains/available.json?api-key=000000000000000&password=00000000$$&domain-name=domain1&tlds=com";

          // Load the API results into an XmlDocument object
          var xmlDoc = new XmlDocument();
          //const string url2 = url.Replace("&", "&");
          xmlDoc.Load(url);

          // Read the results
          var rrpCode = xmlDoc.SelectSingleNode("/interface-response/RRPCode").InnerText;
          var rrpText = xmlDoc.SelectSingleNode("/interface-response/RRPText").InnerText;

          // Perform actions based on results
          switch (rrpCode)
          {
              case "210":
                  Console.WriteLine("Domain available");
                  break;
              case "211":
                  Console.WriteLine("Domain not available");


                  break;
              default:
                  Console.WriteLine("{0} {1}", rrpCode, rrpText);
                  break;
          }

          Console.Read();


Please help us in rectifying this. thnaks in advance friends.
Posted

1 solution

One solution found
Here

Summary:
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900