摘要
将现有的地图服务定义 (MSD) 文件发布到指定的 ArcGIS for Server。
讨论
从 ArcGIS 10.1 for Server 开始,地图服务器定义 (.msd) 文件已被替换为服务定义草稿 (.sddraft) 文件和服务定义 (.sd) 文件。有关详细信息,请参阅以下帮助主题:迁移至 ArcGIS for Server 时可能出现的情况。
使用 ArcPy 将地图文档自动发布到 GIS 服务器的流程分为四步。第一步是运行 CreateMapSDDraft 函数。CreateMapSDDraft 的输出是服务定义草稿 (.sddraft) 文件,服务定义草稿由地图文档、服务器信息和一组服务属性组合而成。随后可使用 AnalyzeForSD 函数分析输出的服务定义草稿文件的适用性和潜在性能问题。紧接着使用 Stage Service 地理处理工具将服务定义草稿转换为完全合并的服务定义 (.sd) 文件。过渡过程会编译成功发布 GIS 资源所需的所有必要信息。如果选择将数据复制到服务器,则将在服务定义草稿阶段添加数据。最后,可以使用上载服务定义地理处理工具上载服务定义文件并将其作为 GIS 服务发布到特定的 GIS 服务器。此步骤将获取服务定义文件、将其复制到服务器、提取所需信息并发布 GIS 资源。有关详细信息,请参阅发布工具集概述。
语法
PublishMSDToServer (msd_path, connection_url_or_name, server, service_name, {folder_name}, {service_capabilities}, {connection_username}, {connection_password}, {connection_domain})
参数 | 说明 | 数据类型 |
msd_path | A string that represents the path and name of an existing MXD document you want to serve. | String |
connection_url_or_name | A string that represents the URL of the ArcGIS for Server to which you want to publish the MSD. | String |
server | A string that represents the ArcGIS for Server host name to which you want to publish the MSD. | String |
service_name | A string that represents the name of the service. This is the name people will see and use to identify the service. The name can only contain alphanumeric characters and underscores. No spaces or special characters are allowed. The name cannot be more than 120 characters in length. | String |
folder_name | A string that represents a folder name to which you want to publish the MSD. If the folder does not currently exist, it will be created. The default folder is the server root level. | String |
service_capabilities [service_capabilities,...] | A list of strings that represents additional capabilities in addition to the map service capability.
(默认值为 MAPPING) | String |
connection_username | A string that represents a user name used to connect to the ArcGIS for Server. To publish a map service, this user name should be a member of the ArcGIS for Server admin group. This variable is only necessary when connecting to a UNIX/Linux ArcGIS for Server. (默认值为 None) | String |
connection_password | A string that represents a password used to connect to the ArcGIS for Server. This variable is only necessary when connecting to a UNIX/Linux ArcGIS for Server. (默认值为 None) | String |
connection_domain | A string that represents a domain name used to connect to the ArcGIS for Server. This variable is only necessary when connecting to a UNIX/Linux ArcGIS for Server. (默认值为 None) | String |