I have an ArcPy script that does a whole bunch of processes with ArcGIS 10.1 to write the output data to a SDE geodatabase. What I want to achieve is to enable an online user to call the script and then do the job on the backend automatically.

I figured out CGI and made a mapping to py on IIS.

However, everything I called the script from the web. It threw out the following error:

HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Creating catid files ESRI\Server10.1\Configuration\CATID\arcgis-response-streamer.catid.ecfg Create JARID File... outfile=ESRI\Server10.1\Configuration\JARID\arcgis-response-streamer.jarid.ecfg Creating catid files ESRI\Server10.1\Configuration\CATID\arcgis_indexer.catid.ecfg Create JARID File... outfile=ESRI\Server10.1\Configuration\JARID\arcgis_indexer.jarid.ecfg Content-Type: text/plain;charset=utf-8 Hello World! starts Hello World! ends ".

I am just wondering if ArcPy script can be exposed to CGI like a normal python script?

  • If you are still interested in this, please provide more info as to what the processes are? I am running arcpy python scripts from asp.net on iis and came across this when searching for CATID and JARID. Maybe you would benefit from geoprocessing services.
    – Justin
    Feb 20, 2014 at 19:41
  • The processes involved accessing raster image files on the local path, running Raster Calculators, writing to a TIFF file for output. That was it. I ended up with not using ASP.NET to call python; I published it on ArcGIS Server as geoprocessing web service instead. Back to the original question, did you manage to solve the same issue?
    – alextc
    Feb 23, 2014 at 22:31
  • I haven't messed with cgi (that I know of). But I am calling python and arcpy from asp.net. I've been trying to get my head around which license is being called for the arcpy lib. Since it is the asp.net on a box with arcgis server, I have a strong feeling that it is that guys license.
    – Justin
    Feb 27, 2014 at 20:35