[OpenLayers-Users] Solution to proxy for WFS request on IIS

zhuhua zha zhuhuazha2004 at yahoo.com.cn
Wed Nov 5 20:43:20 EST 2008


We know that it needs proxy when we use WFS request in
openlayers. Wiki had told us how to add proxy.cgi on
apache, but I can not find useful solution on iis. 
I have done some experiment about proxy on iis
yesterday, and I got a solution for the work at last.
Environment: Openlayers 2.7, Python 2.4, Windows XP,
IIS6.0
Request:    GetFeature request in wfs.
First, Setup Pythoh to c:\python24 ( other directory
you like). And c:\python24 to the environment variable
Path.
Second, add python support on IIS. on IIS  right click
the website, main directory, config, option,
application mapping, add. (My windows XP is Chinese
version, so the name of above in English may not
exact). In the execution file: c:/python24/python.exe
%s %s, in the extension: .py. 
Third, copy the proxy.cgi from examples folder in
OpenLayers 2.7 to website directory like
wwwroot\mybin, change the file name proxy.cgi to
proxy.py. Change the first line 
#!/usr/bin/env python  
to
#!C:/Python24/python.exe -u
This is very important for windows.
Last, add this line in ur init function. 
OpenLayers.ProxyHost = ¡®/mybin/proxy.py?url=¡¯.
OK, refresh your web, u can get response GML file for
the GetFeature request. Have a try.




      ___________________________________________________________ 
 ÑÅ»¢ÓÊÏ䣬ÄúµÄÖÕÉúÓÊÏ䣡 
http://cn.mail.yahoo.com/



More information about the Users mailing list