Exchange EWS SearchMailboxes无效的子元素错误

时间:2014-03-17 21:55:23

标签: exchange-server exchangewebservices

我有一个奇怪的错误。当我尝试执行SearchMailboxes时,我收到此错误:

未处理的异常:Microsoft.Exchange.WebServices.Data.ServiceResponseException:请求"://schemas.microsoft.com/exchange/services/2006/types"具有无效的子元素' ExtendedAttributes'

问题是我在某些电脑上遇到这个错误。使用fiddler,我可以看到我的电脑发送没有节点ExtendedAttributes and it works的请求。

This is the ExtendedAttributes node that produces the error.

代码:

        List<MailboxSearchScope> scopeList = new List<MailboxSearchScope>();
        foreach (SearchableMailbox mb in searchableMailboxes)
        {
            MailboxSearchScope scope = new MailboxSearchScope(mb.ReferenceId, MailboxSearchLocation.All);
            scopeList.Add(scope);
        }

        MailboxQuery query = new MailboxQuery(searchQuery, scopeList.ToArray());

        MailboxQuery[] mbQueryList = new MailboxQuery[] { query };
        SearchMailboxesParameters p = new SearchMailboxesParameters
        {
            SearchQueries = mbQueryList,
            ResultType = SearchResultType.PreviewOnly
        };

        ServiceResponseCollection<SearchMailboxesResponse> res = _service.SearchMailboxes(p);

1 个答案:

答案 0 :(得分:0)

ExtendedAttributes是Exchange 2013 SP1中引入的新元素,仅供内部使用。

http://msdn.microsoft.com/en-us/library/office/dn627392(v=exchg.150).aspx

我在您的代码中没有看到您尝试使用此元素,因此我建议您在实例化ExchangeService对象时指定ExchangeVersion.Exchange2013