Question

I am creating an application that consumes Exchange Web Services (EWS 2.0).

I am using the DeleteItems method (http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservice.deleteitems(v=exchg.80).aspx) to delete multiple email messages from an exchange mailbox.

This method takes a list of item IDs, and returns a collection of responses (ServiceResponse class), one ServiceResponse for each item ID that is passed to the method.

A returned ServiceResponse object does not contain the item ID that it is associated with.

My question is: Can I guarantee that the order of the ServiceResponse objects is the same as the order of the Item IDs that I passed to the method?

I could not find anything in MSDN that talks about the order of responses returned from EWS in such case.

Thank you

Was it helpful?

Solution

Yes, the responses will be returned in the same order as the list of item IDs in the request. The EWS managed API sends the item IDs to the server in the order you specify - it does not change the order or spawn any threads that would mess it up.

All operations such af CopyItem, MoveItem, and DeleteItem work this way: You send a list of item IDs and a list of responses are returned without any direct reference other than the order in which they are returned.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top