【问题标题】:Internal server error with UpdateItem EWS call from Mail Addin来自 Mail Addin 的 UpdateItem EWS 调用的内部服务器错误
【发布时间】:2015-10-26 12:47:54
【问题描述】:

我正在使用 makeEwsRequestAsync 对我刚刚通过与 CopyItem 一起使用的另一个 makeEwsRequestAsync 复制的电子邮件发出 UpdateItem 调用。但是,UpdateItem 的响应如下:

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">*</Action></s:Header><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorInternalServerError</faultcode><faultstring xml:lang="en-US">An internal server error occurred. The operation failed.</faultstring><detail><e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInternalServerError</e:ResponseCode><e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">An internal server error occurred. The operation failed.</e:Message></detail></s:Fault></s:Body></s:Envelope>

有什么想法吗?下面是我正在打的电话。我的目标是创建电子邮件副本,更改主题行和收件人并发送(模拟转发)。奇怪的是,当我在 OWA 中运行邮件插件时,我对 UpdateItem 的调用甚至没有发生,但它在 Outlook 2016 中有效。我现在将忽略它,哈哈

<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'               xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types'>  <soap:Header>     <t:RequestServerVersion Version='Exchange2013'/>  </soap:Header>  <soap:Body>'<UpdateItem MessageDisposition='SaveOnly' ConflictResolution='AutoResolve' xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'> <ItemChanges> <t:ItemChange> <t:ItemId Id='AAMkADk0OGI2NTc3LTZkY2QtNDc1NS05MWM1LTZlNmRhMjQ4MjRlMABGAAAAAACRc/2u6ZxxTKKnN1SuVEBWBwCiPid+VwI1QKpXdMXuhotWAAAAAAEMAACiPid+VwI1QKpXdMXuhotWAADwH8K3AAA=' ChangeKey='CQAAABYAAACiPid+VwI1QKpXdMXuhotWAADvtGmZ'/> <t:Updates> <t:SetItemField> <t:FieldURI FieldURI='item:Subject'/> <t:Message> <t:Subject>UPDATED SUBJECT</t:Subject> </t:Message> </t:SetItemField> </t:Updates> </t:ItemChange> </ItemChanges> </UpdateItem>   </soap:Body></soap:Envelope>

【问题讨论】:

    标签: office365 exchangewebservices


    【解决方案1】:

    我可以看到您的 XML 存在一个问题,您在(Body 和 UpdateItem 之间)有一个额外的 '

    &lt;soap:Body&gt;'&lt;UpdateItem MessageDisposition='SaveOnly'

    删除您的请求后,我的工作正常,您应该确保您拥有最新的 changekey,并且您尝试更新的项目应该位于运行 AddIn 的邮箱中

    干杯 格伦

    【讨论】:

    • 哦,天哪!谢谢格伦!经过这么多年,我终于对 EWS 进行了更深入的研究,实际上我上周正在浏览您的博客以帮助我了解最新情况。好东西!
    • @Glen 如何在 Javascript 中预先验证 XML SOAP 请求?仅仅得到“内部服务器错误”对尝试查找错误没有任何帮助。
    • 如果你能找到一个库,它可以根据 WSDL 验证你的 XML,我自己没有使用过,我个人使用 EWSEditor,它有一个包含 XML 示例的文件夹和一个简单的查询您可以提交一个测试 SOAP 请求。以这种方式在 XML 中发现错误可能非常困难,我从一个工作请求开始,然后只是进行比较,直到我找到耗时的错误,但在调试原始 SOAP 时我还没有找到更好的方法。一个问题是微软实际上在一年前破坏了他们的在线文档(通过将 http 更改为 https),现在应该全部修复
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-06
    相关资源
    最近更新 更多