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

Jorge Gustavo Rocha jgr at di.uminho.pt
Thu Sep 24 07:52:02 EDT 2009


Hi Sasky,

1) To test OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";

You may have a syntax error in the allowedHost array (mission a ').
But please do the following:
Test the proxy directly in the browser, writing down the address of the
proxy followed by the service url you want to use, like:
view-source:http://localhost/cgi-bin/proxy.cgi?url=http://labs.metacarta.com/wms/vmap0
If you write down this on the firefox, you should get:
No query information to decode. QUERY_STRING is set, but empty.
which is ok.

2) To test mapfish.PROXY_HOST = '/proxy/http-proxy.py';

Test the proxy directly in the browser, writing down the address of the
proxy followed by the service url you want to use, like:
view-source:http://localhost/proxy/http-proxy.py/http,demo.mapfish.org/mapfishsample/trunk/polygons?maxfeatures=1
If you write down this on the firefox, you should get:
{"type": "FeatureCollection", "features": [{"geometry": {"type":
"Polygon", "coordinates": [[[15.493156433104, 51.733047485351001],
[15.504142761229469, 51.715881347654815], [15.5175323486318,
51.718756675718822], [15.517189025877883, 51.742918014525017],
[15.532981872557546, 51.723949432371782], [15.547744750975491,
51.729356765745891], [15.53847503662, 51.701805114745],
[15.579330444335, 51.748840332029999], [15.530578613280625,
51.785232543944531], [15.495903015135999, 51.779396057127997],
[15.495903015135999, 51.779396057127997], [15.493156433104,
51.733047485351001]]]}, "id": 12, "type": "Feature", "bbox":
[15.493156433104, 51.701805114745, 15.579330444335, 51.785232543944531],
"properties": {"name": "foo"}}]}

Regards,

jorge
-- 
jorge gustavo rocha
departamento de informática
universidade do minho
4710-057 braga
portugal
N 41º33'44,5" W 8º23'40,5"
tel +351 253604470 fax +351 253604471 cel +351 927210173

Qui, 2009-09-24 às 04:33 -0700, Sasky escreveu:
> I have a file called proxy.cgi and changed the hosts:
> 
> allowedHosts = ['localhost:5000', 'www.openlayers.org', 'openlayers.org',
>              'labs.metacarta.com', 'world.freemap.in',
>              'prototype.openmnnd.org', 'geo.openplans.org',
>  	     'sigma.openplans.org', 'demo.opengeo.org',
>  	     'www.openstreetmap.org', 'sample.avencia.com]
> 
> I also have a file mapfish_proxy.js containing the following code:
> 
>    OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
>    mapfish.SERVER_BASE_URL = '';
> 
> But it still does not work, FireBug still throws the same exeptions.
> 
> Do I have to change more than 'allowedHosts'?
> (Sorry I'm a newbie)
> 
> Thanks a lot.
> 
> 
> iweinzierl wrote:
> > 
> > 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
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> > 
> > 
> 





More information about the Users mailing list