Select to view content in your preferred language

Why does silverlight crash when a geoprocessingservice returns an empy feature layer?

736
1
08-05-2013 03:12 AM
BertHavekes
New Contributor II
I use Python to build geprocessing tools a query on feautures. As a result I sent back a feature layer (derived output) with

arcpy.SetParameter(2,output_layer)

This works perfect in most cases. But the problem is when you did not found where you're looking for. Then the resulting feaute layer is empty. For AGS, this is no problem: The result I get in that case is:

Geoprocessing Parameter: Gevonden_Graafbericht
Data Type: GPFeatureRecordSetLayer

Geometry Type: esriGeometryPolygon

Spatial Reference: 28992

# records: 0


The problem is that when the silverlight viewer get's back this result, the silverlight plugin crashes!!!

Is there anybody how knows the reason, or better, how to fix this?

I'm using ArcGIS Viewer for Silverlight version 3.1 and AGS 10 SP5

kind regards,
Bert Havekes
(from the Netherlands)
0 Kudos
1 Reply
PietaSwanepoel2
Occasional Contributor
Bert,

I assume you are using the GP tools in app builder. Not sure how grasefully the add-in will die when the inputs are not as expected.
Maybe play around with output from the python script. Try returning something like a null value (None in python) if the return is empty.
0 Kudos