<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Java API 403 Error"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Java API 403 Error"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Java API 403 Error</title>
				<description><![CDATA[ Hello,

I found out today about this service, impresive tool, and I tried to add it to a java aplication, by using the api provided, but I get all the time the same 403 error: 

java.io.IOException: Server returned HTTP response code: 403 for URL: http://api.geonames.org/search?q=malaga&username=jrgu

For me it is weird, because when I input the url in the browser it works correctly, is this normal?

I wrote the code given in the exmaple:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
	/**
	 * @param args
	 */
	public static void main&#40;String&#91;&#93; args&#41; {
		// TODO Auto-generated method stub
		List&lt;Toponym&gt; toponymsList = new ArrayList&lt;Toponym&gt;&#40;&#41;;
		try {
			setProxy&#40;&#41;;
			WebService.setUserName&#40;"jrgu"&#41;; // add your username here
			ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria&#40;&#41;;
			searchCriteria.setQ&#40;"malaga"&#41;;
			ToponymSearchResult searchResult = WebService
					.search&#40;searchCriteria&#41;;
			toponymsList = searchResult.getToponyms&#40;&#41;;
		} catch &#40;Exception e&#41; {
			e.printStackTrace&#40;&#41;;
		}
	}
</pre>
		</div>

Thanks,
Joaquín
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4071.page#12076</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4071.page#12076</link>
				<pubDate><![CDATA[Sat, 22 Dec 2012 08:27:00]]> GMT</pubDate>
				<author><![CDATA[ ykcorse]]></author>
			</item>
			<item>
				<title>Re:Java API 403 Error</title>
				<description><![CDATA[ Joaquín 

You have a line "setProxy();" in your code. This is most likely the cause of your problems, that your proxy is not working properly.

Best Regards

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4071.page#12077</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4071.page#12077</link>
				<pubDate><![CDATA[Sat, 22 Dec 2012 15:34:57]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Java API 403 Error</title>
				<description><![CDATA[ Thank you Marc! for some reason I can not get it to work behind a proxy, but it works perfectly when there is no proxy.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4071.page#12116</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4071.page#12116</link>
				<pubDate><![CDATA[Thu, 3 Jan 2013 20:44:28]]> GMT</pubDate>
				<author><![CDATA[ ykcorse]]></author>
			</item>
	</channel>
</rss>