Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
    
Did you ever got a solution to this problem? I think I have the same problem. Instead of a feature layer, my result is a raster layer. –  offermann May 25 '12 at 10:41
    
Have you checked ArcGIS server log for detailed error message? –  iamlaksh1 Mar 25 at 14:18
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.