<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "WebException was unhandle"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "WebException was unhandle"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>WebException was unhandle</title>
				<description><![CDATA[ Hi everybody 

I am trying to use geoname's services to get the latitude and longitude from ZipCode, but all the times it felt down. i couldn't get the connection.

it is just waiting for localhost and finally  it  felt down on this step 


  var webResponse = (HttpWebResponse)request.GetResponse();

WebException was unhandle 


this is my complete function

 public string LookupCoordinates(string Zip, string Country)
    {
        string Lat = "";
        string Lon = "";
        string PostUrl = "http://ws.geonames.org/postalCodeSearch?postalcode=" + Zip + "&maxRows=10&country=" + Country;

        var request = WebRequest.Create(PostUrl);
        var webResponse = (HttpWebResponse)request.GetResponse();

        if (webResponse.StatusCode == HttpStatusCode.OK)
        {   
          
            StreamReader sr = new StreamReader(webResponse.GetResponseStream());
            string Result = sr.ReadToEnd().Trim();
            if (Result != "")
            {
                // Load the response into an XML doc
                XmlDocument xdoc = new XmlDocument();
                xdoc.LoadXml(Result);
                //  Navigate to latitude node
                XmlNodeList name = xdoc.GetElementsByTagName("lat");
                if (name.Count > 0)
                {
                    Lat = name[0].InnerText;
                }
                //  Navigate to longitude node
                name = xdoc.GetElementsByTagName("lng");
                if (name.Count > 0)
                {
                    Lon = name[0].InnerText;
                }
            }
        }
        return (Lat + "," + Lon);
    }
<b><font color='red'></font><font color='#444444'></font></b><font color='red'></font>]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/3783.page#11290</guid>
				<link>http://forum.geonames.org/gforum/posts/list/3783.page#11290</link>
				<pubDate><![CDATA[Fri, 2 Mar 2012 12:52:07]]> GMT</pubDate>
				<author><![CDATA[ mar_mayis]]></author>
			</item>
			<item>
				<title>Re:WebException was unhandle</title>
				<description><![CDATA[ ws.geonames.org is deprecated for 13 months : 
http://geonames.wordpress.com/2011/01/28/application-identification-for-free-geonames-web-services/]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/3783.page#11301</guid>
				<link>http://forum.geonames.org/gforum/posts/list/3783.page#11301</link>
				<pubDate><![CDATA[Sun, 4 Mar 2012 06:49:06]]> GMT</pubDate>
				<author><![CDATA[ geotree]]></author>
			</item>
	</channel>
</rss>