Open mirner opened 8 years ago
We have same problems:
I have this code in Java 1.8.0_51 (ews-java-api 2.0) - connected to EWS Office365: int emailsCount = getEmails(0, 1, folderId).getTotalCount();
definition of function:
private FindItemsResults
If I set value less than totalCount of emails into the second parametr of my getEmails function then I get result into emailsCount variable == -1.
Example: I have 3 emails in my selected folder in my email box.
I invoke method: getEmails(0, 1, folderId).getTotalCount() and I get -1. I invoke method: getEmails(0, 2, folderId).getTotalCount() and I get -1 I invoke method: getEmails(0, 3, folderId).getTotalCount() and I get 3
Thanks for fix of this bug
And this bug is still here. I get -1 after catching ServiceRequestExeption with null definition
microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. null microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:74) microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:158) microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:504) microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:523) microsoft.exchange.webservices.data.core.service.folder.Folder.bind(Folder.java:98) microsoft.exchange.webservices.data.core.service.folder.Folder.bind(Folder.java:114)
We have an account that has messages in it, but code below returns "-1"
FindItemsResults- findResults = exchangeService.findItems(folder.getId(), unreadFilter, unreadView);
findResults.getTotalCount();
Some accounts do it more often than others. The only "fix" we have found is to connect via web or outlook and move all emails to a different folder.