Hello everyone!
I've been trying to publish WMS/WFS services with arcpy in ArcGIS Pro 2.6, but it always ends up with this same error: "code":"00297","message":"WFS layers must be shared with everyone".
I came across that it is originated from this bug: BUG-000095939: Secured Open Geospatial Consortium (OGC) services fr..
My questions are: How can I "share to everyone" with arcpy/python? There is a function or parameter that I've missed?
This is solvable only by changing the sddraft xml?
Below is the main part of the script (thanks to Shilpi Jain from Esri).
arcpy<SPAN class="punctuation token">.</SPAN>SignInToPortal<SPAN class="punctuation token">(</SPAN>portalURL<SPAN class="punctuation token">,</SPAN> username<SPAN class="punctuation token">,</SPAN> password<SPAN class="punctuation token">)</SPAN>
aprx <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mp<SPAN class="punctuation token">.</SPAN>ArcGISProject<SPAN class="punctuation token">(</SPAN>aprxPath<SPAN class="punctuation token">)</SPAN>
m <SPAN class="operator token">=</SPAN> aprx<SPAN class="punctuation token">.</SPAN>listMaps<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Map"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
sharing_draft <SPAN class="operator token">=</SPAN> m<SPAN class="punctuation token">.</SPAN>getWebLayerSharingDraft<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"FEDERATED_SERVER"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MAP_IMAGE"</SPAN><SPAN class="punctuation token">,</SPAN> serviceName<SPAN class="punctuation token">)</SPAN>
sharing_draft<SPAN class="punctuation token">.</SPAN>federatedServerUrl <SPAN class="operator token">=</SPAN> fed_server
sharing_draft<SPAN class="punctuation token">.</SPAN>portalFolder <SPAN class="operator token">=</SPAN> <SPAN class="string token">"SD"</SPAN>
sharing_draft<SPAN class="punctuation token">.</SPAN>serverFolder <SPAN class="operator token">=</SPAN> <SPAN class="string token">"SD"</SPAN>
sharing_draft<SPAN class="punctuation token">.</SPAN>exportToSDDraft<SPAN class="punctuation token">(</SPAN>sddraftPath<SPAN class="punctuation token">)</SPAN>
enable_extensions<SPAN class="punctuation token">(</SPAN>sddraftPath<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"FeatureServer"</SPAN><SPAN class="punctuation token">)</SPAN>
enable_extensions<SPAN class="punctuation token">(</SPAN>sddraftPath<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"WMSServer"</SPAN><SPAN class="punctuation token">)</SPAN>
enable_extensions<SPAN class="punctuation token">(</SPAN>sddraftPath<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"WFSServer"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>StageService_server<SPAN class="punctuation token">(</SPAN>sddraftPath<SPAN class="punctuation token">,</SPAN> sdPath<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>UploadServiceDefinition_server<SPAN class="punctuation token">(</SPAN>sdPath<SPAN class="punctuation token">,</SPAN> fed_server<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thank you for your time,
Cecília