I have this simple code snippet, where I try to fetch folders from specific mailbox
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
ExchangeService service = new ExchangeService();
service.Credentials = new WebCredentials("[email protected]", "********");
Mailbox mb = new Mailbox("[email protected]");
FolderId fid = new FolderId(WellKnownFolderName.MsgFolderRoot, mb);
// Set the URL.
service.Url = new Uri("https://<exchange>/EWS/Exchange.asmx");
var findResults = service.FindFolders(
fid,
new FolderView(int.MaxValue) { Traversal = FolderTraversal.Deep }
);
foreach(var result in findResults)
{
//result.Load();
Console.WriteLine(result.DisplayName);
}
It worked fine before, but today's morning it started to return this error
Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (413) Request Entity Too Large. ---> System.Net.WebException: The remote server returned an error: (413) Request Entity Too Large.
I tried different ways to solve it - mostly by increasing request entity size limit, but it does not help. I suppose code is fine, but VM or Exchange configuration need to be adjusted. Please advice how to solve it, thanks.
