Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

cant get out the folders. No mailbox with such guid. #762

Open
willdomybest opened this issue Oct 27, 2022 · 0 comments
Open

cant get out the folders. No mailbox with such guid. #762

willdomybest opened this issue Oct 27, 2022 · 0 comments

Comments

@willdomybest
Copy link

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
ExchangeCredentials credentials = new WebCredentials("xxx", "xxx");
service.setUrl(new URI("https://mail.xxx.com/EWS/Exchange.asmx"));
service.setCredentials(credentials);
Folder msgFolderRoot = Folder.bind(service, WellKnownFolderName.Root);
int childFolderCount = msgFolderRoot.getChildFolderCount();
FolderView folderView = new FolderView(childFolderCount);
FindFoldersResults findResults = msgFolderRoot.findFolders(folderView);
for (Folder folder : findResults.getFolders()) {
System.out.println("Count======" + folder.getChildFolderCount());
System.out.println("Name=======" + folder.getDisplayName());
}

Log:
Exception in thread "main" microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: No mailbox with such guid.
at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278)
at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165)
at microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:504)
at microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:523)
at microsoft.exchange.webservices.data.core.service.folder.Folder.bind(Folder.java:98)
at microsoft.exchange.webservices.data.core.service.folder.Folder.bind(Folder.java:147)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant