Working model does not work as Geoprocessing Service

2927
8
12-16-2015 09:00 PM
KyleValkenburg
New Contributor

I've got a working model in ArcMap that selects features in a layer that are within a desired distance from a user-entered point, then zooms to the selection.  This model will not let me publish it due to an error (see attached images/files).  What needs to be fixed here?  And why does it work perfectly in ArcMap, but won't allow to be published?

0 Kudos
8 Replies
DanPatterson_Retired
MVP Esteemed Contributor

don't use gp services, but there are two links

Tutorial: Advanced web map printing/exporting using arcpy.mapping—Sharing geoprocessing workflows | ...

Tutorial: Basic web map printing and exporting using arcpy.mapping—Sharing geoprocessing workflows |...

perhaps there is an example there.  'Current' is the reference to an arcmap project which means that you have to have a project open and running for the mapping module to operate in that environment.

KyleValkenburg
New Contributor

Ok, next question, how do I make the (web) map refresh after I make a selection, so I can actually see the results (this is the part that required the try with python code).

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

you will have to expand the error and warning and correct the mistakes using the process in the help.  They give a select by attribute and location example, without the zoom... just keep checking around in that help section to see if it is possible and whether you have provided the necessary information

Geoprocessing service example: Selecting data—Sharing geoprocessing workflows | ArcGIS for Desktop

0 Kudos
DivyamGulati2
New Contributor II

The problem seems to be related to passing 'CURRENT' argument. This would work in ArcMap wouldn't be recognized in a gp service. May be you should specify the path to the map document instead.

mxd = arcpy.mapping.MapDocument(r"c:\Temp\MXD")

KyleValkenburg
New Contributor

This did not help either.  This is beginner stuff here, and i feel like the worlds biggest idiot for not having it work.  I can't even follow the help examples that I keep seeing over and over again (as listed above) because ArcMap won even let me add a service to an mxd (for example). 

I must be missing something fundamental to GP services, because I just can't understand why this stuff isn't working.  Have you looked at my model and script? 

0 Kudos
ChadKopplin
Regular Contributor

Kyle,  part of the is in the High warning below the error.  Your data layers need to be registered with the server in order to be used in a geoprocessing service.

0 Kudos
KyleValkenburg
New Contributor

The weird thing about that is the data copies to the server when I publish, so shouldn't that be ok?

0 Kudos
KyleValkenburg
New Contributor

I actually tried to register the folder anyways, but I have no idea what some of the information Server Manager asks for IS.  "Publisher Folder Path"?  Ect?CaptureServerFolderReg.JPG

0 Kudos