I am new to geoprocessing and I am having trouble figuring out how to return data back to a web client.
I created a simple model that uses a point feature class into the "Frequency" tool. It automatically set the output as a table in the geodatabase. There is a status field with a limited number of options and I want to know how many of each there are. This feature class is updated daily and we want to be able to see statistical data on our web application.
I created a toolbox out of this model and created a geoprocessing service on arcgis server 9.3.
When I run the service on the server it creates a table in the database but does not return data back to the client.
You mentioned your client being a "web client", can you give more details on this? A web app developed through the ADF, a javascript application, something else?
My web application is a Flex based application, but I haven't even tried to use the service in the application yet. I was looking at the geoprocessing service in the REST API services directory. The listing does not show any output parameters and when I execute it from there it does not show any output. Which leads me into another problem. I can only execute it once. It creates a table in the database the first time, but if I try to run it again I get "Error 500." The logs show an "already exists" error.
should get around the already exist error. The %scratchworkspace% tells ArcGIS Server to handle the output, ensuring that nothing is overwritten (or nothing is attempted to be overwrote). Your results will get created at: C:\arcgisserver\arcgisjobs\<service name>\<unique id>\scratch\scratch.gdb\InfoPoints_Frequency
I created a new model using your recommendations and created a new test service in Arcgis Server. An Output Parameter is now showing up, but it fails to run. I get this error in the server log:
Executing (MyFrequency): Model %scratchworkspace%\scratch.gdb\InfoPoints_Frequency Start Time: Thu Jun 10 16:44:57 2010 Executing (Frequency): Frequency \\MyServer\Database\MyDB.mdb\MyDataset\InfoPoints D:\arcgisserver\arcgisjobs\atesttools_gpserver\jb54509f6b5f846fda78bf4e4b7d4d714\scratch\scratch.gdb\InfoPoints_Frequency StatusTxt # Start Time: Thu Jun 10 16:44:58 2010 ERROR 000319: Frequency field StatusTxt does not exist A locator with this name does not exist. Failed to execute (Frequency). End Time: Thu Jun 10 16:44:59 2010 (Elapsed Time: 1.00 seconds) Failed to execute (MyFrequency). End Time: Thu Jun 10 16:44:59 2010 (Elapsed Time: 2.00 seconds)
After playing around with it for a bit I removed the ".gdb" from the output path and was successful running it inside of arccatalog. I am still receiving a different error on the server though:
Executing (MyFrequency): Model %scratchworkspace%\scratch\scratch Start Time: Thu Jun 10 17:15:49 2010 Executing (Frequency): Frequency \\myserver\Database\MyDB.mdb\MyDataset\InfoPoints D:\arcgisserver\arcgisjobs\atool_gpserver\j3d55ce6458de4a8b98d08e2ebe651109\scratch\scratch\scratch StatusTxt # Start Time: Thu Jun 10 17:15:50 2010 ERROR 000319: Frequency field StatusTxt does not exist Item not found in this collection. Failed to execute (Frequency). End Time: Thu Jun 10 17:15:51 2010 (Elapsed Time: 1.00 seconds) Failed to execute (MyFrequency). End Time: Thu Jun 10 17:15:51 2010 (Elapsed Time: 2.00 seconds)