I am trying to make a web service request call to a third part web site who’s server is a little unreliable. Is there a way I can set a timeout on a request to this site? Something like this pseudo code:
try // for 1 minute
{
// Make web request here
using (WebClient client new WebClient()) //...etc.
}
catch
{
}
You could use the Timeout property:
UPDATE:
To answer the question in the comment section about
XElement.Load(uri)you could do the following: