MarkAsJunk 操作错误代码 9020。正在获取 "An internal server error occurred. The operation failed."

MarkAsJunk operation Error Code 9020. Getting "An internal server error occurred. The operation failed."

我正在尝试仅使用带有 Office.context.mailbox.makeEwsRequestAsyncSOAP 请求来使用 MarkAsJunk 操作。为此,我还使用了 easyEWS 模块,它是 OfficeJS 的包装器。我用来发送 SOAP 的代码如下所示:

this.markAsJunk = function (itemId) {
    var soap = '<m:MarkAsJunk IsJunk="true" MoveItem="true"' +
            '          
    xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">' +
            '    <ItemIds>' +
            '        <t:ItemId Id="' + itemId + '"/>' +
            '    </ItemIds>' +
            '</m:MarkAsJunk>';
    soap = getSoapHeader(soap);

    asyncEws(soap, function (data) { });
};

我发送的 SOAP 如下所示:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
   <soap:Header>
        <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
   </soap:Header>
   <soap:Body>
        <m:MarkAsJunk IsJunk="true" MoveItem="true"
        xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <ItemIds>
                <t:ItemId Id="AAMkADg2OGZmNDkzLWVjNDYtNGI2MC1iMGI3LWE3YmEzMDk5MThiNABGAAAAAAC3FQIsRYg6SZwlyqfCFdA0BwBTNDtA08+GRo/QPlH0XaGpAAAAAAEMAABTNDtA08+GRo/QPlH0XaGpAADEMDCVAAA="/>
            </ItemIds>
        </m:MarkAsJunk>
    </soap:Body>
</soap:Envelope>

ItemIds 存在于命名空间 xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 中,因此您需要使用 "m:ItemIds"。 SOAP请求格式请参考教程here