private UserConfigurationType HandleGetUserConfigurationResponse(BaseResponseMessageType response, out bool itemNotFound) { itemNotFound = false; ResponseMessageType responseMessageType = this.HandleBaseResponseMessage(response); if (responseMessageType == null) { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "GetUserConfiguration returned NULL responseType."); return(null); } if (responseMessageType.ResponseCode == ResponseCodeType.ErrorItemNotFound) { itemNotFound = true; return(null); } if (responseMessageType.ResponseCode != ResponseCodeType.NoError) { Globals.ConsistencyChecksTracer.TraceDebug <ResponseCodeType>((long)this.GetHashCode(), "Web request returned ResponseCodeType {0}.", responseMessageType.ResponseCode); return(null); } GetUserConfigurationResponseMessageType getUserConfigurationResponseMessageType = responseMessageType as GetUserConfigurationResponseMessageType; if (getUserConfigurationResponseMessageType == null || getUserConfigurationResponseMessageType.UserConfiguration == null) { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "GetUserConfiguration web request returned NULL UserConfiguration."); return(null); } return(getUserConfigurationResponseMessageType.UserConfiguration); }
private static void FetchRetentionPolicyTagDataFromService(StoreRetentionPolicyTagHelper srpth) { StoreRetentionPolicyTagHelper.InitializeServiceBinding(srpth); if (srpth.serviceBinding != null) { GetUserConfigurationType getUserConfiguration = new GetUserConfigurationType { UserConfigurationName = new UserConfigurationNameType { Name = "MRM", Item = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.inbox } }, UserConfigurationProperties = (UserConfigurationPropertyType.Dictionary | UserConfigurationPropertyType.XmlData | UserConfigurationPropertyType.BinaryData) }; StoreRetentionPolicyTagHelper.CallEwsWithRetries(() => srpth.serviceBinding.GetUserConfiguration(getUserConfiguration), delegate(ResponseMessageType responseMessage, int messageIndex) { GetUserConfigurationResponseMessageType getUserConfigurationResponseMessageType = responseMessage as GetUserConfigurationResponseMessageType; if (getUserConfigurationResponseMessageType.ResponseClass == ResponseClassType.Success && getUserConfigurationResponseMessageType.UserConfiguration != null) { if (getUserConfigurationResponseMessageType.UserConfiguration.XmlData != null) { ExTraceGlobals.ELCTracer.TraceDebug(0L, "Acquired MRM user configuration."); srpth.TagData = MrmFaiFormatter.Deserialize(getUserConfigurationResponseMessageType.UserConfiguration.XmlData, srpth.exchangePrincipal, out srpth.deletedTags, out srpth.retentionHoldData, true, out srpth.defaultArchiveTagData, out srpth.fullCrawlRequired); srpth.configItemExists = true; } else { ExTraceGlobals.ELCTracer.TraceDebug(0L, "MRM user configuration is null"); srpth.TagData = new Dictionary<Guid, StoreTagData>(); srpth.configItemExists = false; } return true; } if (getUserConfigurationResponseMessageType.ResponseClass == ResponseClassType.Error && getUserConfigurationResponseMessageType.ResponseCode == ResponseCodeType.ErrorItemNotFound) { ExTraceGlobals.ELCTracer.TraceDebug(0L, "MRM user configuration not found"); srpth.TagData = new Dictionary<Guid, StoreTagData>(); srpth.configItemExists = false; return true; } ExTraceGlobals.ELCTracer.TraceDebug(0L, "Getting MRM user configuration failed"); return false; }, srpth); return; } throw new ElcUserConfigurationException(Strings.ElcUserConfigurationServiceBindingNotAvailable); }
// Token: 0x06000577 RID: 1399 RVA: 0x00029938 File Offset: 0x00027B38 public byte[] GetMrmConfiguration(BaseFolderIdType folderId) { byte[] userConfiguration = null; GetUserConfigurationType getUserConfiguration = new GetUserConfigurationType { UserConfigurationName = new UserConfigurationNameType { Name = "MRM", Item = folderId }, UserConfigurationProperties = (UserConfigurationPropertyType.Dictionary | UserConfigurationPropertyType.XmlData | UserConfigurationPropertyType.BinaryData) }; this.CallService(() => this.ServiceBinding.GetUserConfiguration(getUserConfiguration), delegate(ResponseMessageType responseMessage, int messageIndex) { if (responseMessage.ResponseClass == ResponseClassType.Error) { if (responseMessage.ResponseCode != ResponseCodeType.ErrorItemNotFound) { throw new RetryException(new ElcEwsException(ElcEwsErrorType.FailedToGetUserConfiguration, responseMessage.ResponseCode.ToString() + " : " + responseMessage.MessageText), false); } ElcEwsClient.Tracer.TraceDebug <string>(0L, "MRM user configuration was not found in the mailbox of {0}.", this.exchangePrincipal.MailboxInfo.PrimarySmtpAddress.ToString()); } else { GetUserConfigurationResponseMessageType getUserConfigurationResponseMessageType = responseMessage as GetUserConfigurationResponseMessageType; if (getUserConfigurationResponseMessageType != null && getUserConfigurationResponseMessageType.UserConfiguration != null && getUserConfigurationResponseMessageType.UserConfiguration.XmlData != null) { userConfiguration = getUserConfigurationResponseMessageType.UserConfiguration.XmlData; } else { ElcEwsClient.Tracer.TraceDebug <string>(0L, "MRM user configuration was not in the GetUserConfiguration response of {0}", this.exchangePrincipal.MailboxInfo.PrimarySmtpAddress.ToString()); } } return(false); }, (Exception exception) => ElcEwsClient.WrapElcEwsException(ElcEwsErrorType.FailedToGetUserConfiguration, exception)); return(userConfiguration); }