public void ServerOn(IList <ConnectionVO> ConnInfoList, bool UseMessageSecurity) { ServiceConnController scc = null; //SOAP서비스 컨트롤러 DBController dc = null; //DB서비스 컨트롤러 #region WCF 서비스 켜기(SOAP 활성) if (UseMessageSecurity && this.MessageCredentialType != MessageCredentialType.None && this.MessageCredentialType != null) { scc = ServiceConnController.getInstance(SOAPErrReporter, this.MessageCredentialType, this.certPath, this.certPassword); } else { scc = ServiceConnController.getInstance(SOAPErrReporter); } foreach (ConnectionVO connVO in ConnInfoList) { scc.AddServiceURL(connVO.ServiceURL); } #endregion #region DB커넥션 활성 dc = DBController.getInstance(ConnInfoList); #endregion #region DB커낵션과 SOAP 중 하나라도 활성안된 서비스는 둘다 죽인다 StringCollection DeActivedURL = new StringCollection(); foreach (string url in scc.ServiceDic.Keys) { if (!dc.ActiveDBKeyList.Contains(url)) { DeActivedURL.Add(url); } } foreach (string url in dc.ActiveDBKeyList) { if (!scc.ServiceDic.Keys.Contains(url)) { DeActivedURL.Add(url); } } foreach (string url in DeActivedURL) { scc.ServiceDic[url].Dispose(); scc.ServiceDic.Remove(url); dc.Dispose(url); } #endregion ActiveServiceList = dc.ActiveDBKeyList; }
/// <summary> /// 서비스 준비 /// </summary> /// <param name="UseMessageSecurity"></param> public void ServerOn(bool UseMessageSecurity) { EncryptionPassword = GetMacAddr(); this.ActiveServiceDic = new Dictionary <string, bool>(); if (UseMessageSecurity && this.MessageCredentialType != MessageCredentialType.None) { this.ServiceConnController = ServiceConnController.getInstance(SOAPErrReporter, this.MessageCredentialType, this.certPath, this.certPassword); } else { this.ServiceConnController = ServiceConnController.getInstance(SOAPErrReporter); } if (this.dbConn == null) { this.dbConn = DBController.getInstance(); } }
public void ServerOFF() { DBController.getInstance().Dispose(); ServiceConnController.getInstance().Dispose(); }