I have about 500 web services. I tired to use Ping but it dont seem to be accurate. I have tested web client and download to string. Using stopwatch i calculated the download time. Its also not so accurate. What is the best method to identify the availability of the web service?
Stopwatch sw = new Stopwatch();
sw.Start();
pingable = a.IsAddressAvailable(nameOrAddress);
sw.Stop();
public bool IsAddressAvailable(string address)
{
try
{
System.Net.WebClient client = new WebClient();
client.DownloadData(address);
return true;
}
catch
{
return false;
}
}