public void Stop(string serverName, string serviceName, bool bDelete) { IGISServerConnection pGISServerConnection = null; IServerObjectAdmin pServerObjectAdmin = null; try { serviceName = CleanServiceName(serviceName); pGISServerConnection = new GISServerConnection(); pGISServerConnection.Connect(serverName); pServerObjectAdmin = pGISServerConnection.ServerObjectAdmin; pServerObjectAdmin.StopConfiguration(serviceName, "MapServer"); if (bDelete == true) { pServerObjectAdmin.DeleteConfiguration(serviceName, "MapServer"); } } catch (Exception ex) { throw ex; } finally { COMUtil.ReleaseObject(pServerObjectAdmin); COMUtil.ReleaseObject(pGISServerConnection); } }
public void Stop(string serverName, string serviceName, bool bDelete, string sAgsAdminUser, string sAgsAdminPwd) { serviceName = CleanServiceName(serviceName); try { if (!ConnectAGS(serverName, sAgsAdminUser, sAgsAdminPwd)) { throw new ApplicationException("Could not get server connection to " + serverName); } soAdmin.StopConfiguration(serviceName, "MapServer"); if (bDelete == true) { soAdmin.DeleteConfiguration(serviceName, "MapServer"); } COMUtil.ReleaseObject(soAdmin); soAdmin = null; } catch (Exception ex) { throw ex; } }