[Users] Geoext2 and proxy.cgi

Juliette Fabre juliette.fabre at univ-montp2.fr
Wed Jul 9 14:28:11 CEST 2014


Hello,

I recently started using GeoExt2. With OpenLayers, I was using this 
version of proxy.cgi : 
http://trac.osgeo.org/openlayers/browser/trunk/openlayers/examples/proxy.cgi.

With GeoExt2, I encountered problems to run a WMS GetCapabilities. I 
solved it by modifying the proxy.cgi like in this post : 
http://www.geoext.org/pipermail/users/2011-May/002287.html.

But with this new version of proxy.cgi, the WMSGetFeatureInfo query 
fails with the error 500 'Some unexpected error occurred. Error text 
was: list index out of range'.
Actually the queried URL is URL encoded :

http://localhost/cgi-bin/proxy.cgi?url=http%3A%2F%2F162.38.140.226%3A8080%2Fgeoserver%2Fsf%2Fwms%3FSERVICE%3DWMS%26LAYERS%3Dsf%253Aborehole%26QUERY_LAYERS%3Dsf%253Aborehole%26STYLES%3D%26SERVICE%3DWMS%26VERSION%3D1.1.1%26REQUEST%3DGetFeatureInfo%26EXCEPTIONS%3Dapplication%252Fvnd.ogc.se_inimage%26BBOX%3D-5315418.716245%252C4750095.377026%252C5916543.966529%252C7166728.462954%26FEATURE_COUNT%3D10%26HEIGHT%3D247%26WIDTH%3D1148%26FORMAT%3Dimage%252Fpng%26INFO_FORMAT%3Dapplication%252Fvnd.ogc.gml%26SRS%3DEPSG%253A900913%26X%3D603%26Y%3D127, 


.. while the same URL without encoding succeeds:

|http://localhost/cgi-bin/proxy.cgi?url=http://162.38.140.226:8080/geoserver/sf/wms?SERVICE=WMS&LAYERS=sf%3Aborehole&QUERY_LAYERS=sf%3Aborehole||&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_inimage||&BBOX=-5315418.716245%2C4750095.377026%2C5916543.966529%2C7166728.462954&FEATURE_COUNT=10&HEIGHT=247||&WIDTH=1148&FORMAT=image%2Fpng&INFO_FORMAT=application%2Fvnd.ogc.gml&SRS=EPSG%3A900913&X=603&Y=127|

If I go back to the original version of  proxy.cgi, the 
WMSGetFeatureInfo query succeeds, and the WMS GetCapabilities fails.

Here is the beginning of my proxy.cgi file, with lines that allow WMS 
GetCapabilities query to work but prevent WMSGetFeatureInfo query from 
working:

/#!/usr/bin/env python//
//
//import urllib2//
//import cgi//
//import sys, os//
//
//# Designed to prevent Open Proxy type stuff.//
//
//allowedHosts = ['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.azavea.com',//
//                'v2.suite.opengeo.org', 'v-swe.uni-muenster.de:8080', //
//                'vmap0.tiles.osgeo.org', 'www.openrouteservice.org', 
'162.38.140.226:8080', 'services.sandre.eaufrance.fr']//
//
//method = os.environ["REQUEST_METHOD"]//
//qs = os.environ['QUERY_STRING']////# Added to solve problem with 
geoext and WMSgetCapabilities//
//
if method == "POST":
     qs = os.environ["QUERY_STRING"]
     d = cgi.parse_qs(qs)
     if d.has_key("url"):
         url = d["url"][0]
     else:
         url = "http://www.openlayers.org"
else:
     fs = cgi.FieldStorage()
     #url = fs.getvalue('url', "http://www.openlayers.org") //# Removed 
to solve problem with geoext and WMSgetCapabilities//
//url = qs[4:] //# Added to solve problem with geoext and 
WMSgetCapabilities/



Would you have any idea to solve this?

Thanks,

Juliette
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20140709/e7918471/attachment.htm 


More information about the Users mailing list