I am writing a custom widget for Flex Viewer to perform a geoprocessing task. I've been wrestling with using a selected feature from a FeatureLayer as input to a geoprocessing task that is looking for a FeatureSet input for several days. Relevant code snippet:
[INDENT]var inputPolyFS:FeatureSet = new FeatureSet();
inputPolyFS.features = [{ geometry: draftConsLayer.selectedFeatures[0] }];
var params:Object = { "Clip_Features": inputPolyFS };
gpWetlands.execute(params);[/INDENT]draftConsLayer is a FeatureLayer, and can have at most one feature selected. According to the .../rest/services/... URL, the Clip_Features input is supposed to be of type GPFeatureRecordSetLayer. When I perform the .execute I receive an error message indicating:
"Unexpected fault:
[FaultEvent fault=[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="Invalid value for parameter 'Clip_Features'
The specified geometry is not in the correct format."] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]"
Anyone have any suggestions about the mismatch?
Many thanks in advance,
Dave