2

I am trying to automate the process of publishing a geoprocessing service to ArcGIS for Server 10.2.2, using a python script:

import arcpy  
result = r"C:\data\ContourLineFunction.rlt"  
connectionPath = r"C:\Users\sof\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\arcgis on localhost_6080 (admin).ags"  
sddraft = "ContourLineFunction.sddraft"  
sd = "ContourLineFunction.sd"  
serviceName = "ContourLineFunction"  

# create service definition draft  
arcpy.CreateGPSDDraft(  
    result, sddraft, serviceName, server_type="ARCGIS_SERVER",  
    connection_file_path=connectionPath, copy_data_to_server=False,  
    folder_name=None, summary="lorem ipsum", tags="gp",  
    executionType="Synchronous", resultMapServer=False,  
    showMessages="INFO", maximumRecords=1000, minInstances=1,  
    maxInstances=5, maxUsageTime=100, maxWaitTime=10, maxIdleTime=180)  

analyzeMessages = arcpy.mapping.AnalyzeForSD(sddraft)

The result from the AnalyzeForSD function contains multiple errors 001243:

{  
  'errors':  
    {  
      (u'ERROR 001243: The ContourLineFunction/in_string_version parameter is missing a syntax dialog explanation in the item description', 92): [],  
      (u'ERROR 001243: The ContourLineFunction/yCoordinate parameter is missing a syntax dialog explanation in the item description', 92): [],  
      (u'ERROR 001242: Tool ContourLineFunction is missing item description summary', 80): [],  
      (u'ERROR 001243: The ContourLineFunction/xCoordinate parameter is missing a syntax dialog explanation in the item description', 92): [],  
      (u'ERROR 001243: The ContourLineFunction/radius parameter is missing a syntax dialog explanation in the item description', 92): []} ...  

I know I can get rid of the errors by manually entering item descriptions in the Service Editor in ArcMap/ArcCatalog.

I have tried to find the settings in the sddraft file, but nothing looked like the right place for the values.

I have tried to find something inside the .rlt-file (geoprocessing result), but this was all binary stuff inside a ZIP file :-(

How can I automate the setting of the item descriptions?

6
  • X-post in Esri Geonet: geonet.esri.com/message/426475#426475
    – offermann
    Commented Oct 2, 2014 at 8:01
  • I am not 100%, but it seems as you are supposed to add the syntax dialog information which you have to do for the tool you run. Try to edit the syntax information for the tool (right-click the tool in Catalog window in ArcMap and choose Item Description) and go through the workflow again. Commented Oct 2, 2014 at 8:33
  • Thanks for this hint. I can open the item description window for the tool, but there is no edit button :-( [The edit button is available for the toolbox] The tool itself is implemented in C#, may be I have to implement the item description in ArcObjects? Haven't found the right Interface for this, though...
    – offermann
    Commented Oct 2, 2014 at 9:45
  • Ah I see. There is a very scary KB article on editing info of custom tools, worth a look :) support.esri.com/es/knowledgebase/techarticles/detail/27000. Is it possible to rewrite the tool in Python? It's been such a painful process for me to push custom tools as GP services, strongly suggest moving to Python asap. Commented Oct 2, 2014 at 9:52
  • Our custom tools depend heavily on finer grained ArcObjects, and our customer would not pay for the migration if it is not absolutely needed. Personally, I like to use arcpy and arcobjects both the same way, each has its own benefits.
    – offermann
    Commented Oct 2, 2014 at 12:06

1 Answer 1

1

To deploy a custom .NET tool, you would need to document the tool first. Refer to A quick tour of documenting tools and toolboxes for the steps.

However, to document a DLL-based custom tool, you need to enable Item Description first. Consult Enable ArcMap to create documentation for custom geoprocessing tools for details.

After editing the registry as outlined in the KB article, you should be able to edit the item details in Catalog window just as for other GP tools and models.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.