Select to view content in your preferred language

how to publish gp svc w/ custom output zip file

2347
1
05-22-2011 12:32 PM
ChrisBeaudette
Frequent Contributor
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?
0 Kudos
1 Reply
matuskajba
Emerging Contributor
Hm, first things first. You must publish a geoprocessing service that will be consumed by your .net application. So you have a script file, put it into toolbox (check somewhere here http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools), define input, output (zip file) - you have custom script tool. Apply this tool to your model (in model builder), set the input (i don't know what suppose to be input in your service) and set the value of output (your zip file) like "%scratchworkspace%/myoutput.zip" (check somewhere here http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Key_concepts_for_geoprocessing_service...). The output will be myoutput.zip file in directory generated by arcgis server (you will get the url after successful execution.
0 Kudos