<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hallo everyone!!<BR>
I use this proxy.py file and i am trying to get information for a map feature clicking on it, but the computer returns this message:<BR>
"Some unexpected error occurred. Error text was:" Can anyone help me? Where am i wrong? <BR>
<BR>
See my map at <A href="http://84.205.237.73/default/mytest.aspx">http://84.205.237.73/default/mytest.aspx</A><BR> <BR> <BR> <BR> <BR><STRONG><U><FONT style="FONT-SIZE: 12pt" size=3>Proxy.py code</FONT></U></STRONG><BR>#!C:/Python26/python.exe -u<BR> <BR>import urllib2<BR>import cgi<BR>import sys, os<BR># Designed to prevent Open Proxy type stuff.<BR>allowedHosts = ['84.205.237.73:443', 'www.openlayers.org', 'openlayers.org', <BR> 'labs.metacarta.com', 'world.freemap.in', <BR> 'prototype.openmnnd.org', 'geo.openplans.org',<BR> 'sigma.openplans.org',<BR> 'www.openstreetmap.org']<BR>method = os.environ["REQUEST_METHOD"]<BR>if method == "POST":<BR> qs = os.environ["QUERY_STRING"]<BR> d = cgi.parse_qs(qs)<BR> if d.has_key("url"):<BR> url = d["url"][0]<BR> else:<BR> url = "<A href="http://www.openlayers.org/">http://www.openlayers.org</A>"<BR>else:<BR> fs = cgi.FieldStorage()<BR> url = fs.getvalue('url', "<A href="http://www.openlayers.org/">http://www.openlayers.org</A>")<BR>try:<BR> host = url.split("/")[2]<BR> if allowedHosts and not host in allowedHosts:<BR> print "Status: 502 Bad Gateway"<BR> print "Content-Type: text/plain"<BR> print<BR> print "This proxy does not allow you to access that location (%s)." % (host,)<BR> print<BR> print os.environ<BR> <BR> elif url.startswith("http://") or url.startswith("https://"):<BR> <BR> if method == "POST":<BR> length = int(os.environ["CONTENT_LENGTH"])<BR> headers = {"Content-Type": os.environ["CONTENT_TYPE"]}<BR> body = sys.stdin.read(length)<BR> r = urllib2.Request(url, body, headers)<BR> y = urllib2.urlopen(r)<BR> else:<BR> y = urllib2.urlopen(url)<BR> <BR> # print content type header<BR> i = y.info()<BR> if i.has_key("Content-Type"):<BR> print "Content-Type: %s" % (i["Content-Type"])<BR> else:<BR> print "Content-Type: text/plain"<BR> print<BR> <BR> print y.read()<BR> <BR> y.close()<BR> else:<BR> print "Content-Type: text/plain"<BR> print<BR> print "Illegal request."<BR>except Exception, E:<BR> print "Status: 500 Unexpected Error"<BR> print "Content-Type: text/plain"<BR> print <BR> print "Some unexpected error occurred. Error text was:", E<BR><BR>------------------------------------------------------------------<BR> <BR><STRONG><U><FONT style="FONT-SIZE: 12pt" size=3>getfeatureinfo code</FONT></U></STRONG><BR> <BR>.<BR>.<BR>.<BR>OpenLayers.ProxyHost = "/script/proxy.py?url=";<BR>.<BR>.<BR>.<BR>map.events.register('click', map, function (e) {<BR> document.getElementById('nodelist').innerHTML = "Please wait...";<BR> var params = {<BR> REQUEST: "GetFeatureInfo",<BR> EXCEPTIONS: "application/vnd.ogc.se_xml",<BR> BBOX: map.getExtent().toBBOX(),<BR> X: e.xy.x,<BR> Y: e.xy.y,<BR> INFO_FORMAT: 'text/html',<BR> QUERY_LAYERS: map.layers[0].params.LAYERS,<BR> FEATURE_COUNT: 50,<BR> Layers: 'Tinos:dimoi',<BR> Styles: '',<BR> Srs: 'EPSG:900913',<BR> WIDTH: map.size.w,<BR> HEIGHT: map.size.h,<BR> format: format};<BR> OpenLayers.loadURL("<A href="http://84.205.237.73:443/geoserver/wms">http://84.205.237.73:443/geoserver/wms</A>", params, this, setHTML, setHTML);<BR> OpenLayers.Event.stop(e);<BR> });<BR> <BR> <BR> // sets the HTML provided into the nodelist element<BR> function setHTML(response){<BR> document.getElementById('nodelist').innerHTML = response.responseText;<BR> };<BR><BR><br /><hr />Κάντε κλικ για να παίξετε Fishticuffs με τους φίλους σας, τώρα! <a href='http://www.livemessenger-emoticons.com/fishticuffs/el-gr/' target='_new'>Κάντε κλικ εδώ!</a></body>
</html>