for layer in layer_list: # generate gkey_query based on variable `layer` queryURL = baseURL + gkey_query # generates a valid map service URL feature_set = arcpy.FeatureSet() feature_set.load(queryURL) # do stuff with feature_set
This works as expected when executed as part of a toolbox Python script. However, when the script is then published as a geoprocessing service, it fails as follows (emphasis mine):
esriJobMessageTypeError: Traceback (most recent call last): File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 215, in network_trace_group = trace_network(start_gkey, stop_gkey_list) File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 158, in trace_network feature_set.load(queryURL) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\arcobjects.py", line 175, in load return convertArcObjectToPythonObject(self._arc_object.Load(*gp_fixargs(args))) RuntimeError: RecordSetObject: Cannot open table for Load
It appears that the published service isn't able to access map services. Is this possible and I just need to modify the URL in some way, or is this something that geoprocessing services aren't able to do?
(We are still on Desktop 10.2.1; not sure what the Server version is, but I can ask if necessary.)