Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.
System.Net.WebException: Unable to connect
In my case, some domains worked, while some did not. Adding a reference to my organization's proxy Url in my web.config fixed the issue.