Checking if a webservice (or any URL to that matter) is online.

Nov 8 2006 10:30 AM

I googled around for it this morning and to my surprise couldn't find any quick and easy solution, so I started searching the namespaces and found this. Hope this helps.

System.Net.
WebRequest wr = System.Net.WebRequest.Create([URL]);
wr.GetResponse();
//this method throws a '404 not found' exception if it couldn't connect to the url.