laptop and a wrench

漏洞

The UpdateConnectionProperties method appends "URL=" to the Server parameter of the updated layer, resulting in a broken data source.

ArcGIS Pro
漏洞 ID 编号 BUG-000171987
已提交November 4, 2024
上次修改时间September 11, 2025
适用范围ArcGIS Pro
找到的版本3.2.4
操作系统Windows OS
操作系统版本11.0 64 bit
状态In Review

附加信息

Unlike Feature Services and many other data types, Map Services are not yet supported in the function. Map Services are also not supported in the Update Data Sources panel within the Catalog View in ArcGIS Pro. By setting the function, you are forcing the new URL into the layer, even though it is currently unsupported. If you set it, the layer will not be updated, which is by design until Map Services are officially supported. But you can modify the CIM definition of the layer like this to update the Map Service URL: aprx = arcpy.mp.ArcGISProject('current') m = aprx.listMaps('Map')[0] lyr = m.listLayers('PyUnit10931_2')[0] c = lyr.getDefinition('V3') c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer' lyr.setDefinition(c) More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS

解决办法

Unlike Feature Services and many other data types, Map Services are not yet supported in UpdateConnectionProperties at this time. But you can modify the CIM definition of the layer like this: aprx = arcpy.mp.ArcGISProject('current') m = aprx.listMaps('Map')[0] lyr = m.listLayers('PyUnit10931_2')[0] c = lyr.getDefinition('V3') c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer' lyr.setDefinition(c) More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS

重现步骤

漏洞 ID: BUG-000171987

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项