MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server

114
0
4 weeks ago
ANH
by
New Contributor II

Hi team,

I am experiencing an issue where the MakeFeatureLayer_management() function. When I run it on my local machine, it returns the feature layer, but when I run the same script on the server it fails. See below:

token = "_____"
url = fr"https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token={token}"
layer_name = "Target Service Name"
layer = MakeFeatureLayer_management(url, layer_name).getOutput(0)

ERROR: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token=_____ does not exist or is not supported
Failed to execute (MakeFeatureLayer).

 

I am just trying convert the REST URLs into objects that can be used in arcpy geoprocessing tools and cursors. Does anyone know why this error is occurring or whether there is another way to connect to these endpoints?

Please note that this script is completely ad-hoc - it isn't part of a geoprocessing service or anything like that.

0 Kudos
0 Replies