/// <summary> /// 将抛出异常信息存入数据库 /// </summary> /// <param name="error"></param> public void AddErrorMessage(string error) { IWCFService.IAdvertManageService advertService = WcfAccessProxy.AMS_ServiceProxy.CreateChannelAdvertManageService(); try { advertService.AddErrorMessage(error); } catch { throw; } finally { ICommunicationObject ICommObjectService = advertService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }