getWebLayerSharingDraft not found

1294
4
11-02-2018 06:31 AM
BenJenkins
New Contributor II

When trying to create an sd draft file with <map object variable>.getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "nAmEblAH") I get the error "'Map' object has no attribute 'getWebLayerSharingDraft'". I'm following the example exactly as its shown here FeatureSharingDraft—Sharing module | ArcGIS Desktop and can't work out the issue. Is this a known bug? I'm using pro version 2.1.2. 

4 Replies
BenJenkins
New Contributor II

I used CreateWebLayerSDDraft instead, it worled. 

0 Kudos
DamasoAvalos_Ruiz1
New Contributor III

Hello

Did you find any reason why this happens?

I am guessing it is because Arcgis Pro run Python 3.6 and ArcGis server still run under Python 2.7. But I am just guessing. I got lost among all those ESRI help online web pages.

0 Kudos
by Anonymous User
Not applicable

The arcpy.sharing module (containing getWebLayerSharingDraft) was introduced at ArcGIS Pro 2.2 to provide a better experience when sharing web layers over the previously existing function CreateWebLayerSDDraft. The original function is provided only for backward compatibility.

Introduction to arcpy.sharing—Sharing module | Documentation

0 Kudos
LiamAbbate
New Contributor

That still does not address the issue of the error of:

name 'getWebLayerSharingDraft' is not defined  

 

0 Kudos