【Arcgis Server】程序动态发布MXD到Arcgis Server
http://dkay.blogbus.com/logs/47727282.html
protected void Button14_Click(object sender, EventArgs e)
{
IGISServerConnection pGISServerConnection;
pGISServerConnection = new GISServerConnectionClass();
//请注意:connect输入的主机名,表示要连接的服务器
pGISServerConnection.Connect("superzhang");
IServerObjectAdmin pServerObjectAdmin;
pServerObjectAdmin = pGISServerConnection.ServerObjectAdmin;
IServerObjectConfiguration2 configuration = (IServerObjectConfiguration2)pServerObjectAdmin.CreateConfiguration();
configuration.Name = "NewService";//发布Service的名称,必填
configuration.TypeName = "MapServer";//发布服务的类型,如:MapServer,GeocodeServer
IPropertySet props = configuration.Properties;
props.SetProperty("FilePath", @"D:\gis data\world.mxd");//设置MXD的路径
//一下的property并非必须,只要一个filepath就可以发布
props.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput");//图片的输出目录
props.SetProperty("VirtualOutPutDir", "http://superzhang:8399/arcgis/server/arcgisoutput");//图片输出的虚拟路径
props.SetProperty("SupportedImageReturnTypes", "URL");//支持的图片类型
props.SetProperty("MaxImageHeight", "2048");//图片的最大高度
props.SetProperty("MaxRecordCount", "500");//返回记录的最大条数
props.SetProperty("MaxBufferCount", "100");//缓冲区分析的最大数目
props.SetProperty("MaxImageWidth", "2048");//图片的最大宽度
props.SetProperty("IsCached", "false");//是否切片
props.SetProperty("CacheOnDemand", "false");//是否主动切片
props.SetProperty("IgnoreCache", "false");//是否忽略切片
props.SetProperty("ClientCachingAllowed", "true");//是否允许客户端缓冲
props.SetProperty("CacheDir", "c:\\arcgisserver\\arcgiscache\\NewService");//切片的输出路径
props.SetProperty("SOMCacheDir", "c:\\arcgisserver\\arcgiscache");//som的切片输出路径
configuration.Description = "NewService";//Service的描述
configuration.IsolationLevel = esriServerIsolationLevel.esriServerIsolationHigh;//或者esriServerIsolationLow,esriServerIsolationAny
configuration.IsPooled = true;//是否池化
configuration.MaxInstances = 1;//最多的实例数
configuration.MinInstances = 1;//最少的实例数
//设置刷新
IPropertySet recycleProp = configuration.RecycleProperties;
recycleProp.SetProperty("StartTime", "00:00");//刷新开始时间
recycleProp.SetProperty("Interval", "3600");//刷新间隔
//设置是否开启REST服务
IPropertySet infoProp = configuration.Info;
infoProp.SetProperty("WebEnabled", "true");//是否提供REST服务
infoProp.SetProperty("WebCapabilities", "Map,Query,Data");//提供何种服务
configuration.StartupType = esriStartupType.esriSTAutomatic;//或者esriSTManual
configuration.UsageTimeout = 120;//客户端占用一个服务的最长时间
configuration.WaitTimeout = 120;//客户端申请一个服务的最长等待时间
//添加服务到Server
pServerObjectAdmin.AddConfiguration(configuration);
//启动服务
pServerObjectAdmin.StartConfiguration("NewService", "MapServer");
}
相关文章
- vscode安装插件实时预览live server
- SQL SERVER全面优化-------Expert for SQL Server 诊断系列
- 如何使用Spark SQL 的JDBC server
- SQL SERVER 2008 “阻止保存要求重新创建表的更改”
- VIEW SERVER STATE permission was denied on object 'server', database 'master'
- [Nuxt] Setup a "Hello World" Server-Rendered Vue.js Application with the Vue-CLI and Nuxt
- SQL SERVER全面优化-------Expert for SQL Server 诊断系列
- Team Foundation Server 安装配置教程
- SQL Server中clustered与nonclustered的区别
- nodejs TCP server和TCP client如何建立连接
- WebShop WebSocket server 和WebSocket客户端的一对多关系维护
- C# 连接SQL Server数据库的几种方式--server+data source等方式
- 0402-服务注册与发现-Eureka Server使用、将服务注册到Eureka server上
- jQuery ajax读取本地json文件_jQuery请求本地JSON文件,在谷歌浏览器运行时报跨域错误_Vscode使用Live Server