如何解决EWS托管API:会话不是复制项目上的IMailboxSession
我们正在使用EWS托管API处理我们的交换公用文件夹中的项目。我们能够遍历文件夹,检索新项目并进行更改。可以将项目移动到特定文件夹,但是当我们使用复制方法时,会发生奇怪的异常:发生内部服务器错误。操作失败。,IdAndSession.MailboxSession:会话不是IMailboxSession
要排除代码问题,我使用Microsoft提供的示例:
// As a best practice,limit the properties returned by the Bind method to only those that are required.
PropertySet propSet = new PropertySet(BasePropertySet.IdOnly,EmailMessageSchema.Subject,EmailMessageSchema.ParentFolderId);
// Bind to the existing item by using the ItemId.
// This method call results in a GetItem call to EWS.
EmailMessage originalMessage = EmailMessage.Bind(service,ItemId,propSet);
// Copy the orignal message into another folder in the mailbox and store the returned item.
Item item = originalMessage.Copy("epQ/3AAA=");
// Check that the item was copied by binding to the copied email message
// and retrieving the new ParentFolderId.
// This method call results in a GetItem call to EWS.
EmailMessage copiedMessage = EmailMessage.Bind(service,item.Id,propSet);
Source 但是仍然发生异常。这可能是Framework中的错误吗? 预先感谢您的帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。