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

Sasky sassymaus at gmx.net
Tue Sep 29 09:38:48 EDT 2009


Hello again, 

meanwhile I do not have problems with the proxy any longer. 
I did not see that I've set the wrong path to the host, correctly it must be
OpenLayers.ProxyHost = "cgi-bin/proxy.cgi?url=" in my case and not
"/cgi-bin/proxy.cgi?url="

But now I've got another problem :/ 
Firebug is complaining about an "Unsupported geometry type: Box"

layer = new OpenLayers.Layer.WFS( "WFS",
            "mylocalserver",
            {typename: "base", maxfeatures: 100},
			      {
				      projection: new OpenLayers.Projection("EPSG:31467"),
				      extractAttributes:true,
				      visibility: true
			      });

But I have no idea, how to solve this. Thanks a lot.
Sasky


Sasky wrote:
> 
> Hello, 
> 
> When I write down this 
> http://localhost/cgi-bin/proxy.cgi?url=http://labs.metacarta.com/wms/vmap0
> in Firefox, I get an empty white page.
> I set up a Proxy like described on
> http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost
> but I still get the same errormessage. 
> 
> I'm not using a Mapfish Server, so do I have to set this:
> mapfish.PROXY_HOST = '/proxy/http-proxy.py';
> Or does it has to be emtpy then:  mapfish.PROXY_HOST = ' '; ?
> 
> Thanks a lot
> 
> 
> Jorge Gustavo Rocha wrote:
>> 
>> 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
>>> > 
>>> > 
>>> 
>> 
>> 
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>> 
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Access-to-restricted-URI-denied-code-1012-when-added-WFS-tp3704885p3736319.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list