sbaglieri
sbaglieri

Reputation: 319

Exchange EWS SearchMailboxes invalid child element error

I have a strange error. When i try to do a SearchMailboxes, I get this error:

Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceResponseException: The request "://schemas.microsoft.com/exchange/services/2006/types" has invalid child element 'ExtendedAttributes'

The problem is that i get this error in some pc's. With fiddler I could see that my pc sends a request without the node ExtendedAttributes and it works.

This is the ExtendedAttributes node that produces the error.

The code:

        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);

Upvotes: 0

Views: 702

Answers (1)

Bob Bunn
Bob Bunn

Reputation: 613

ExtendedAttributes is a new element that was introduced in Exchange 2013 SP1 and is intended for internal use only.

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

I don't see in your code where you are trying to use this element so I would suggest that you specify ExchangeVersion.Exchange2013 when you are instantiating your ExchangeService object.

Upvotes: 0

Related Questions