My basic problem is that I have a custom function tool HLZCalulation that I created. It takes in a string to a file gdb , opens it, does some calculations, and then returns a featurelayer with the results of said calculations. The tool works as both a simple tool and a model, returning the correct features and not reporting any errors. However, when I publish the model as a service and try to run it from ArcMap, it reports success message from the server but the output feature class is empty. When I check the server job folder, it has created the shapefile with the features inside it but fails to return the featurelayer without throwing any specific errors (the REST portal returns success message, then a fail message – see error message below).
Packing the parameter is done at the end of execute (once the shapefile is created) rather than validate as with the calculate area sample on the esri site, which could be a problem. The output parameter definition is included below, as well as the lines of code for packing the parameter, and the output from running the rest portal(in browser)
any ideas?
//////////////////////////////////////////////////////////PARAM DEFINITION
// Output parameter (Derived) and data type is GPFeatureLayerTypeClass
IGPParameterEdit2 outputParameter = new GPParameterClass();
outputParameter.DataType = new GPFeatureLayerTypeClass();
// Value object is GPFeatureLayerClass
outputParameter.Value = new GPFeatureLayerClass();
// Set output parameter properties
outputParameter.Direction = ESRI.ArcGIS.Geoprocessing.esriGPParameterDirection.esriGPParameterDirectionOutput;
outputParameter.DisplayName = "HLZ Output FeatureClass";
outputParameter.Name = "hlz_featureclass";
outputParameter.ParameterType = ESRI.ArcGIS.Geoprocessing.esriGPParameterType.esriGPParameterTypeDerived;
parameters.Add(outputParameter);
//////////////////////////PACKAGE PARAM
IGPValue resultFeatureLayer = m_gpUtilities.CreateFeatureLayer(resultFeaturePath + ".shp");
IGPParameter parameter = (IGPParameter)userParamValues.get_Element(OUTPUT_PARAM);
m_gpUtilities.PackGPValue(resultFeatureLayer, parameter);
//////////////Rest Portal output
esriJobMessageTypeInformative: Submitted.
esriJobMessageTypeInformative: Executing...
esriJobMessageTypeInformative: Executing (Model): Model # D:\data\test\TGD_CLIP.gdb
esriJobMessageTypeInformative: Start Time: Mon Oct 11 17:29:18 2010
esriJobMessageTypeInformative: Executing (HLZ Calculation): HLZCalculation D:\data\test\TGD_CLIP.gdb #
esriJobMessageTypeInformative: Start Time: Mon Oct 11 17:29:18 2010
esriJobMessageTypeInformative: Intersect completed, should return
esriJobMessageTypeInformative: Executed (HLZ Calculation) successfully.
esriJobMessageTypeInformative: End Time: Mon Oct 11 17:32:08 2010 (Elapsed Time: 2 minutes 50 seconds)
esriJobMessageTypeInformative: Executed (Model) successfully.
esriJobMessageTypeInformative: End Time: Mon Oct 11 17:32:08 2010 (Elapsed Time: 2 minutes 50 seconds)
esriJobMessageTypeError: Failed.