[OpenLayers-Users] Access to restricted URI denied" code: "1012" when added WFS

Ingo Weinzierl ingo.weinzierl at intevation.de
Thu Sep 24 04:51:47 EDT 2009


Hi Sasky,

the WFS layer uses the XMLHttpRequest object to fetch its data. If you try to 
request the data from a remote host, you get into the problem of the Same 
Origin Policy [1], which denies loading data from remote hosts. To avoid 
this, you will need to set up a proxy on the host your site is running on ( 
see [2]). I hope this helps.

[1] http://en.wikipedia.org/wiki/Same_origin_policy
[2] http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost

Regards, Ingo

On Thursday 24 September 2009 10:36:17 Sasky wrote:
> Hi all,
>
> I am building a client with mapfish using Openlayers. I am using a seperate
> server, so I don't work with a mapfish server.
> My client works fine, but now I want to add some vector layers, so I can
> add edit and search-functions later.
>
> So I am trying to add a layer.WFS from the openlayers example:
>
> layer = new OpenLayers.Layer.WFS( "Owl Survey",
>    "http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",
>   {typename: "OWLS", maxfeatures: 10},
>   { featureClass: OpenLayers.Feature.WFS});
> map.addLayer(layer);
>
> But then FireBug throws some errors:
> 1) uncaught exception: [Exception... "Component returned failure code:
> 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult:
> "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame ::
> file://MapFish-1.1/client/examples/nwsib/mfclient/openlayers/lib/OpenLayers
>/Request/XMLHttpRequest.js
>
> :: anonymous :: line 200" data: no]
>
> [Break on this error] (no source for )
>
> 2) Access to restricted URI denied" code: "1012
> [Break on this error] this._object.send(vData);\n
>
> And I have no idea how to fix it. I used google already, but it didn't help
> me so far.
>
> Does anybody have an idea?


-- 
Ingo Weinzierl				              OpenPGP key: 0x2D2E2573
http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück; AG Osnabrück, HR B 18998
Geschäftsführer:   Frank Koormann,  Bernhard Reiter,  Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090924/8704cfd9/attachment.bin


More information about the Users mailing list