Select to view content in your preferred language

Debugging a Geoprocessing service

3160
4
01-31-2011 01:04 AM
faisalmoeen
Deactivated User
Is there any way to debug a geoprocessing service? I have made a model that calculates the population of any area marked by the user through drawing tools by using "Zonal Stats as a Table" tool. I have published it as a service. It works fine in arcmap but returns empty results when called from any web api. The server log shows that the service and the model has executed successfully but i get empty results in any web api.
0 Kudos
4 Replies
ArokiyaJoseph
Deactivated User
Faisal,

Have you verified your License for ArcGIS Server Spatial Analyst Extension?
0 Kudos
faisalmoeen
Deactivated User
1)    yes it is verified because i am using arcserver advanced which has spatial extension built in. Is there any specific way to verify the license?
2)    when the same service is included in arcmap as a toolbox, it works fine. Can the web apis display table as the final result of the service is a table?
3)    Can I pick up a single value from a table and use it as model output parameter?
0 Kudos
KevinHibma
Esri Regular Contributor
Based on your information, your license level should be fine.

I'm not sure which API you're using, but have a look at this link. It actually uses the Zonal tool inside to get a value. The code actually does the work of grabbing a single value from the results table to display it.

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/gp_zonalstats.html

..if you arent using JavaScript, I believe the other APIs make use of a similar example. Just look for "Population Zonal Stats" or "Population Summary"
0 Kudos
ArokiyaJoseph
Deactivated User
Is there any specific way to verify the license?

[INDENT]Yes. If it is a license failure, result.dat file in <arcgisserver>\ arcgisjobs\<toolname_gpserver>\<job id> folder will have a "T h e t o o l i s n o t l i c e n s e d" message.

You can also verify the current license level of your server by examining the keycodes file.
In windows: Program Files/ESRI/License10.0/sysgen/keycodes
In Linux: $HOME/.esriprogramfiles/{your_machine_name}/esri/License10.0/sysgen/keycodes[/INDENT]

Can the web apis display table, as the final result of the service is a table?

[INDENT]Yes, the output table will be automatically converted to GPRecordSet(Look for GPRecordSet) parameter type and web apis will be able to display it.[/INDENT]

Can I pick up a single value from a table and use it as model output parameter?

[INDENT]Yes, it is possible. The best way to approach it is to append the Calculate Value Tool to your model and get the desired output. But remember, the output of Calculate Value tool should be a supported parameter type.[/INDENT]

I also urge you to watch Devsummit 2010 Geoprocessing Services tech workshop to understand supported parameter types and Debugging Geoprocessing services.
0 Kudos