<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Permission denied to call method XMLHttpRequest.open"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/6.page</link>
		<description><![CDATA[Latest messages posted in the topic "Permission denied to call method XMLHttpRequest.open"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Calling the geonames webservice from javascript gives the Error: uncaught exception: Permission denied to call method XMLHttpRequest.open

Most browsers enforce a cross-domain security restriction. This means your javascript code can only access the server from which the javascript has been loaded. As geonames.org is a different server you cannot directly call the geonames webservice using XMLHttpRequest.

Workarounds :

* use one of our JSON webservices. With JSON you don't have this problem : http://www.geonames.org/export/JSON-webservices.html
* Use a software proxy on your server forwarding the requests to geonames.org.
* use apache modrewrite


Links :

http://nothing-more.blogspot.com/2005/09/xmlhttprequest-security.html
http://spaces.msn.com/members/siteexperts/Blog/cns%211pNcL8JwTfkkjv4gg6LkVCpw%212776.entry

]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#12</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#12</link>
				<pubDate><![CDATA[Sat, 31 Dec 2005 18:27:52]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Thanks for your nice system - its great.

I'm using your service with javascript with the url:

request = 'http://ws.geonames.org/findNearbyPostalCodesJSON?lat=' + point.y + '&lng=' + point.x + '&callback=getLocation'; 

and its working very good.

I found the query http://ws.geonames.org/wikipediaSearch and I got the problem to access it with java-script.

Is there a JSON query too for the wikipedia search like

http://ws.geonames.org/wikipediaSearchJSON?q=cologne&maxRows=10&lang=de

It would be a nice help.

Erik

erik (-at-) koelschwasser (point) de]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#327</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#327</link>
				<pubDate><![CDATA[Thu, 6 Jul 2006 09:18:12]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Hi Erik

All Wikipedia services are now available in XML and JSON.

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#334</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#334</link>
				<pubDate><![CDATA[Thu, 6 Jul 2006 19:56:57]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Im having a huge problem with this

Im getting a 403 permission denied error but im not using javascript

Am using PHP fopen

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>function get_longlat&#40;$postcode,$placename&#41; 
{
        $ret = "";
        $url = "http://ws.geonames.org/postalCodeSearch?postalcode=" . $postcode . "&placename=". $placename ."&maxRows=1";
		$url = str_replace&#40;" ","%20",$url&#41;;
		
        $handle = fopen&#40;$url,"rb"&#41;;
        $contents = "";
        while &#40;!feof&#40;$handle&#41;&#41; { $contents .= fread&#40;$handle, 8192&#41;; }
        fclose &#40;$handle&#41;;
        
		preg_match&#40;'/&lt;lat&gt;&#40;&#91;^\&lt;&#93;*&#41;/', $contents, $matches&#41;;
        $lat = $matches&#91;1&#93;;
        $ret = $ret . $lat . ",";
        preg_match&#40;'/&lt;lng&gt;&#40;&#91;^\&lt;&#93;*&#41;/', $contents, $matches&#41;;
        $lng = $matches&#91;1&#93;;
        $ret = $ret . $lng;
        return $ret;
}</pre>
		</div>

Its only happening on one of my hosting accounts - on the other the code runs fine

Is there some security setting that has to be turned on on the linux server to allow it to make external http requests?]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#1559</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#1559</link>
				<pubDate><![CDATA[Thu, 8 Feb 2007 02:38:55]]> GMT</pubDate>
				<author><![CDATA[ Fuzzy Orange]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ We are using the FindNearestAddress service via javascript and are getting the permission denied error.
Is this service available as JSON?  I didn't see it in the list.....

<a href='http://ws.geonames.org/findNearestAddress' target='_new' rel="nofollow">http://ws.geonames.org/findNearestAddress</a>]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#1905</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#1905</link>
				<pubDate><![CDATA[Tue, 17 Apr 2007 21:42:51]]> GMT</pubDate>
				<author><![CDATA[ LauraWilson]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Hi Laura

Yes it is available as JSON : http://www.geonames.org/maps/reverse-geocoder.html

Cheers

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#1906</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#1906</link>
				<pubDate><![CDATA[Tue, 17 Apr 2007 22:08:12]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ Hey im a bit confused. I to get the XMLHttp error but I tried doing it by jSON type. I'm using the DOJO framework what exactly do I need to do to run it as a json and use the work around?

My current code is this
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>   	function GetCountryData&#40;coory,coorx&#41;
	{
		sendUrl = 'http://ws.geonames.org/countrycode?lat=' + coory + 'lng=' + coorx + '&type=JSON';
	dojo.io.bind&#40;{
			url: sendUrl,
			load: function&#40;type, data, evt&#41;{alert&#40;data&#41;},
			error: function&#40;type, data, evt&#41;{},
			mimetype: "text/plain" 
		}&#41;;
	}
	</pre>
		</div>]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#2269</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#2269</link>
				<pubDate><![CDATA[Thu, 14 Jun 2007 17:40:56]]> GMT</pubDate>
				<author><![CDATA[ akhan]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ I don't know the DOJO framework, but it seems it is not making a JSON call. Did you try using another mime type? In this example they are using text/json :

http://today.java.net/pub/a/today/2006/04/27/building-ajax-with-dojo-and-json.html

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#2277</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#2277</link>
				<pubDate><![CDATA[Sun, 17 Jun 2007 12:02:08]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ The problem is the same-origin policy that most browsers enforce.

Here is on solution to the problem.

http://glowfilter.com/articles/web/development/permission-denied-to-call-method-xmlhttprequest.open/

]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#4395</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#4395</link>
				<pubDate><![CDATA[Fri, 25 Jul 2008 02:13:43]]> GMT</pubDate>
				<author><![CDATA[ johnknyc]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ i am working on google map to integrate weather onto the map.I am getting permission denied error when using json for weather. 

this is my code

GDownloadUrl("http://ws.geonames.org/findNearByWeatherJSON?lat="+point.y+"&lng="+point.x+"",
	function(data2){
	var jsonData = eval('(' + data2 + ')');
	weatherHTML = "<table width='200'><tr><td align='left'>Temp : </td><td align='left'>"+jsonData.weatherObservation.temperature+"</td></tr><tr><td align='left'>clouds : </td><td align='left'>"+jsonData.weatherObservation.clouds+"</td></tr></table>"
	});

Hope someone will help me to make this work.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#4470</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#4470</link>
				<pubDate><![CDATA[Fri, 8 Aug 2008 12:08:32]]> GMT</pubDate>
				<author><![CDATA[ senthil]]></author>
			</item>
			<item>
				<title>Re:Permission denied to call method XMLHttpRequest.open</title>
				<description><![CDATA[ GDownloadURL is using XmlHttpRequest behind the scenes and subject to the same restrictions.

http://code.google.com/apis/maps/documentation/reference.html#GDownloadUrl

You will have to use a JSON call to read data from the GeoNames server directly with the browser.

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/11.page#4475</guid>
				<link>http://forum.geonames.org/gforum/posts/list/11.page#4475</link>
				<pubDate><![CDATA[Sat, 9 Aug 2008 17:08:41]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>