Hello,
Is there a way to publish with python a feature service that is not hosted (in my sde)?
Thank you.
Ok, if I understood you correctly, the python code I refered to only works since ArcGIS Pro 2.3 (January 2019)?
This script worked wonderfully until we upgraded to ArcGIS Pro 2.9.1, then I had to switch the way firstChild was set in order to get feature server enabled in the sddraft. Throws a bunch of errors but seems to be working anyway 🙂
extElement.firstChild.data = 'true'
became:
extElement.firstChild.nodeValue = 'true'
I am also looking to write a python script that will publish a feature layer (that does not contain '(hosted)' in its name-it behaves differently than a regular feature layer, and I cannot consume that feature layer from a third party software). I've only found documentation on using getWebLayerSharingDraft, exporting that draft using exportToSDDraft, staging that draft using StageService_server, then uploading using UploadServiceDefinition_server, but then it published a 'Feature_Layer (hosted)' and I cannot use that layer in a webmap. I cannot find the difference between a Feature Layer and a Feature Layer (hosted), nor how to create the former using an arcpy script.
(my ultimate goal is to feed into a script the feature classes I want, and have the script set symbology, enable Sync and editing, name the layers a specific name, publish 3 different feature layers, then bundle them into a web map, ready for consumption by a third party software-it has to have exact configurations, thus the need for a script that configures the map the same way every time).
Hi,
I did found a solution I don’t fully remember it now but I crated SD draft and before crating the SD itself I parse it with an xml library and changed the values so it will be a feature service from my SDE.
Its and old code that I did for a client so I don’t have it on my, but this was the idea, and it worked.
I don’t remember if it was for this part of the code but I use both of the python env in this script both python 3 and python 2, because off different capability that I needed. It was done with subprocess.
Good Day.