c# - 使用 `GetConversationItems` 时抛出的调用者或应用程序无法使用请求的 Web 方法

标签 c# asp.net email exchangewebservices

在我的 Outlook Web 加载项中,我使用 Office.js 的 getCallbackTokenAsync 在连接到我的 asp.net 后端中的 EWS 之前获取 token 。

ExchangeService service = new ExchangeService();
                service.Url = new Uri(mailItem.ewsUrl);
                service.Credentials = new OAuthCredentials(mailItem.ewsToken);
                PropertySet ps = new PropertySet(
                                                ItemSchema.Subject,
                                                );
                _email = EmailMessage.Bind(service, new ItemId(mailItem.itemID),ps);
//the following throws error
    ConversationResponse response = service.GetConversationItems(convId,
                                                                 properties,
                                                                 null,
                                                                 foldersToIgnore,
                                                                 ConversationSortOrder.TreeOrderDescending);

当我使用 Office.js 检索到的 token 来初始化 EWS 服务时,似乎不允许使用此 GetConversationItems 方法。我尝试将 list 权限更新为最高级别的 ReadWriteMailBox 但仍然无法正常工作。好像只能用Office.js来调用EWS

最佳答案

从 getCallbackTokenAsync 获取的 token 仅用于检索当前项目或当前项目上的附件。 欲了解更多信息,请参阅以下链接:

getCallbackTokenAsync

最诚挚的问候,

埃文

关于c# - 使用 `GetConversationItems` 时抛出的调用者或应用程序无法使用请求的 Web 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52601753/

相关文章:

c# - websocket 连接失败?

python - 在 App Engine/Python 中发送 HTML 电子邮件?

email - 使用 "Send"参数调用 "1"的 PowerShell 异常 : "Failure sending mail."

c# - 如何比较更改的表单文件 - ( .Designer InitializeComponent )

c# - Visual C# 2010 速成版 : Specify default access modifier for new classes?

c# - 如何通过 GET 调用 ASMX 网络服务?

asp.net - ASP.NET 中是否存在共享 session 的概念?

asp.net - 什么是中等信任级别?

c# - 解释这个 : CheckBox checkbox = (CheckBox)sender;

javascript - 如何将 Office 365 邮件消息 REST 响应转换为字节 []