I was trying to see how I could get a timezone based on US zip code and found a post that suggested using a web service. I can see the methods when I view this in a browser. In VS, I started adding the web reference and used the link and clicked "Go". It finds the site and displays the available methods but won't allow me to add the reference and displays the following:
There was an error downloading 'http://www.webservicex.net/uszip.asmx/_vti_bin/ListData.svc/$metadata'. The request failed with the error message:
System.InvalidOperationException: _vti_bin/ListData.svc/$metadata Web Service method name is not valid. at System.Web.Services.Protocols.HttpSe
(this is all the error I can copy/paste). I cannot contact the web site for help, they only have mailing address. I was wondering if anyopostne knows how to resolve this.
UPDATE:
I tried both methods and keep getting:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 173.201.44.188:80
This is what I used, using both methods:
// Method 1
WebServiceNetX.USZip ZipCoding = new WebServiceNetX.USZip();
System.Xml.XmlNode ZipInfo = ZipCoding.GetInfoByZIP(sZip);
string sOutput = ZipInfo.OuterXml;
// Method 2
string url = @"http://www.webservicex.net/uszip.asmx/GetInfoByZIP?USZip=" + sZip;
System.Net.WebClient webClient = new System.Net.WebClient();
webClient.Encoding = Encoding.UTF8;
string result = webClient.DownloadString(url);