c_r_b

how to publish gp svc w/ custom output zip file

Discussion created by c_r_b on May 22, 2011
Latest reply on Apr 17, 2012 by matus
I'm setting up a v9.3.1 gp svc that creates a zip file (which contains a shapefile) that I'd like to publish as an ArcGIS Server gp service to be consumed by a SOAP client in a .NET Web app.  The gp service references a toolbox w/ a v9.3.1 python script that creates the zip file. It currently creates a custom output directory that is not related to the scratchworkspace.  I'm trying to figure out is how to make the zip file available from the gp service so that the SOAP client can check on the status and get the resulting zip file when the gp service is 'successful', e.g.

if (jobStat == esriJobStatus.esriJobSucceeded)
{
   GPResult results = gpserver.GetJobResult(jobID, null, resultOptions);
   GPDataFile zipfile = (GPDataFile)results.Values[0];
}


My python script currently has this:
gp.FeatureClassToFeatureClass_conversion(myLayer, outputDir, outputShapeName, queryExpr)
zipfolder.zipFolder(outputDir, outZipFile)

zipfolder.zipFolder is a customized module of the v9.3 zip python script, but it writes the zip file to a custom folder -- it doesn't create gp output.

My gp tool has an output parameter of type 'file', but I'm not clear on how to implement it.

Questions:
1. How do I mod the zip logic in the v9.3 zip python script to create a gp service output?
2. Do I have to output the file into the scratchworkspace to be able to consume it from a calling client app?

Outcomes