2 wen501192551 wen501192551 于 2016.05.12 10:23 提问

ArcGis Engine10.1发布地图服务到Arcgis Server,出现了错误,如下 10C

服务成功发布到了Server上,但是无法启动服务,求助大牛。。。
代码如下:
string serverName = "http://localhost:6080/arcgis/admin";
string mxdFilePath = @"D:\southGis\Data\xyz.mxd";
string serviceName = "tiles02223";
string username = "gis123";
string password = "gis123";

//发布地图服务
public void PublishMapServer(string strServerName, string strMxdPath, string strServiceName, string username, string password)
{
IServerObjectAdmin pServerObjectAdmin = ConnectAGS(strServerName, username, password);

        IServerObjectConfiguration5 configuration = (IServerObjectConfiguration5)pServerObjectAdmin.CreateConfiguration();
        configuration.Name = strServiceName;//发布Service的名称,必填
        configuration.TypeName = "MapServer";//发布服务的类型,如:MapServer,GeocodeServer
        configuration.TargetCluster = "default";
        configuration.StartupType = esriStartupType.esriSTAutomatic;
        configuration.IsolationLevel = esriServerIsolationLevel.esriServerIsolationHigh;
        configuration.IsPooled = true;//是否池化
        configuration.Description = "tiles000000000001";

        configuration.MaxInstances = 2;//最多的实例数
        configuration.MinInstances = 1;//最少的实例数
        configuration.WaitTimeout = 60;
        configuration.UsageTimeout = 600;
        configuration.IdleTimeout = 1800;

        //customize recycle properties
        IPropertySet propertySet_Recycle = configuration.RecycleProperties;
        propertySet_Recycle.SetProperty("StartTime", "00:00");
        propertySet_Recycle.SetProperty("Interval", "24");
        //设置SOC属性
        IPropertySet pPropertySet = configuration.Properties;
        pPropertySet.SetProperty("FilePath", strMxdPath);//MXD路径
        pPropertySet.SetProperty("MaxRecordCount", "1000");

        pPropertySet.SetProperty("SupportedImageReturnTypes", "MIME + URL");//支持的图片类型
        IEnumServerDirectory dirs = pServerObjectAdmin.GetServerDirectories();
        dirs.Reset();
        IServerDirectory serverDir = dirs.Next();
        while (serverDir != null)
        {
            if (((IServerDirectory2)serverDir).Type == esriServerDirectoryType.esriSDTypeOutput)
            {
                pPropertySet.SetProperty("OutputDir", serverDir.Path);  //输出目录
                pPropertySet.SetProperty("VirtualOutputDir", serverDir.URL);   //输出虚拟目录
                break;
            }
            serverDir = dirs.Next();
        }

        IPropertySet info = configuration.Info;
        info.SetProperty("WebEnabled", "true");
        info.SetProperty("WebCapabilities", "Map,Query,Data");

        //添加服务到Server
        pServerObjectAdmin.AddConfiguration(configuration);
        //启动服务
        pServerObjectAdmin.StartConfiguration(strServiceName, "MapServer");

}
代码执行到pServerObjectAdmin.AddConfiguration(configuration);时报错了,错误信息是 ERROR: service failed to start, Cannot connect to this server.

2个回答

CSDNXIAON
CSDNXIAON   2016.05.12 10:33

ArcGIS Server 发布地图服务
ArcGIS Server 地图服务叠加
ArcGIS server安装与发布地图服务
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

baidu_22560959
baidu_22560959   2016.07.12 11:48

我老师说。不能mxd直接发布服务,要将mxd转换为msd 才行,但是我不会转换为msd。他说用脚本做一个arcgis的工具做转换。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!