ListDatasets problem with Geoprocessing Service

1908
2
Jump to solution
10-30-2014 07:51 AM
Mohamed_MagdyMohamed_Hussain
New Contributor III

I create a Python Script as Show below to print the list of Datasets in arcpy.AddMessage() this script run successfully for (*.gdb, *.sde) but when publish this script as Geoprocessing Service it work successfully for (*.gdb) only and return empty list for (*.sde).

Note: The two workspaces I used as “E:\WSTest.gdb” and “E:\WSTest.sde” where SDE is for SQL Server Express 2008R2

WS_in is string for the path of Workspace


import arcpy


WS_in = arcpy.GetParameterAsText(0)


arcpy.env.workspace = WS_in
arcpy.AddMessage(arcpy.env.workspace)


lst = arcpy.ListDatasets()
arcpy.AddMessage(lst)
for i in lst:
    arcpy.AddMessage(i)







0 Kudos
1 Solution

Accepted Solutions
DallasShearer
Occasional Contributor

you might need to register the database connection on the server.

Here's a link in case you are unfamiliar with this setup.

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

View solution in original post

0 Kudos
2 Replies
DallasShearer
Occasional Contributor

you might need to register the database connection on the server.

Here's a link in case you are unfamiliar with this setup.

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

0 Kudos
Mohamed_MagdyMohamed_Hussain
New Contributor III

Thank you it work

0 Kudos