无法从Outlook加载项使用EWS UpdateItem操作

时间:2017-10-14 00:50:01

标签: exchangewebservices office-js outlook-web-addins

我正在尝试使用IPM.Configuration.OWA.UserOptions消息通过来自带有UpdateItem的Outlook Web插件的EWS(SOAP)请求更新ReadWriteMailbox消息中的字典元素权限。但是它在响应中失败并出现以下错误:

ErrorAccessDenied: Office extension is not allowed to update this type of item.

我正在使用的UpdateItem请求是一个相当简单的示例,用于通过它的ID更新消息并设置扩展属性的值:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"               xmlns:xsd="http://www.w3.org/2001/XMLSchema"               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:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
      <m:ItemChanges>
        <t:ItemChange>
          <t:ItemId Id="AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MABGAAAAAACxU7lpjO+oS5hB0UfA6muFBwDcAGmTk49MRrSCdR7rvVFPAAAAAAEBAADcAGmTk49MRrSCdR7rvVFPAAD2pXuVAAA=" ChangeKey="CQAAABYAAADcAGmTk49MRrSCdR7rvVFPAAD2uhNb" />
          <t:Updates>
            <t:SetItemField>
              <t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
              <t:Message>
                <t:ExtendedProperty>
                    <t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
                    <t:Value>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxVc2VyQ29uZmlndXJhdGlvbj4NCgk8SW5mbyB2ZXJzaW9uPSJFeGN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3bHBqTytvUzVoQjBVZkE2bXVGQVFEY0FHbVRrNDlNUnJTQ2RSN3J2VkZQQUFBQUFBRVBBQUE9IiAvPg0KCQk8ZSBrPSIxOC1Jc09wdGltaXplZEZvckFjY2Vzc2liaWxpdHkiIHY9IjMtRmFsc2UiIC8+DQoJCTxlIGs9IjE4LUlzRm9jdXNlZEluYm94RW5hYmxlZCIgdj0iMy1UcnVlIiAvPg0KCQk8ZSBrPSIxOC1OZXdFbmFibGVkUG9udHMiIHY9IjktMjE0NzQwMTcyNyIgLz4NCgkJPGUgaz0iMTgtc2lnbmF0dXJlaHRtbCIgdj0iMTgtJmx0O2h0bWwmZ3Q7JiN4RDsmI3hBOyZsdDtoZWFkJmd0OyYjeEQ7JiN4QTsmbHQ7L2hlYWQmZ3Q7JiN4RDsmI3hBOyZsdDtib2R5Jmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDsmYW1wO25ic3A7Jmx0Oy9wJmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDstLSZsdDsvcCZndDsmI3hEOyYjeEE7Jmx0O3AmZ3Q7SXp6eiBhbSBKYW5pY2smbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDtwJmd0OyZhbXA7bmJzcDsmbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDsvYm9keSZndDsmI3hEOyYjeEE7Jmx0Oy9odG1sJmd0OyYjeEQ7JiN4QTsiIC8+DQoJPC9EYXRhPg0KPC9Vc2VyQ29uZmlndXJhdGlvbj4=</t:Value>
                </t:ExtendedProperty>                
              </t:Message>
            </t:SetItemField>
          </t:Updates>
        </t:ItemChange>
      </m:ItemChanges>
    </m:UpdateItem>
  </soap:Body>
</soap:Envelope>

我在UserOptions消息中更新的0x7c07属性包含我已修改的各种签名相关字典属性的base64编码值:

<?xml version="1.0" encoding="utf-8"?>
<UserConfiguration>
    <Info version="Exchange.12" />
    <Data>
        <e k="18-IsFocusedInboxOnLastUpdateTime" v="18-01/01/0001 00:00:00" />
        <e k="18-autoaddsignature" v="3-True" />
        <e k="18-UserOptionsMigrationState" v="9-5" />
        <e k="18-themeStorageId" v="18-" />
        <e k="18-autoaddsignatureonreply" v="3-True" />
        <e k="18-timezone" v="18-Central Standard Time" />
        <e k="18-signaturetext" v="18-&#xD;&#xA;--&#xD;&#xA;Izzz am Janick&#xD;&#xA;&#xD;&#xA;" />
        <e k="18-FavoriteFolders" v="1-18-3-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEMAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEJAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEPAAA=" />
        <e k="18-IsOptimizedForAccessibility" v="3-False" />
        <e k="18-IsFocusedInboxEnabled" v="3-True" />
        <e k="18-NewEnabledPonts" v="9-2147401727" />
        <e k="18-signaturehtml" v="18-&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;--&lt;/p&gt;&lt;p&gt;John Doe&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;;" />
    </Data>
</UserConfiguration>

我无法找到任何说明UpdateItem操作允许或不允许的内容的文档(the list should be here)。目前,Graph或Mail API也无法更新Outlook Online签名。如果我最终想要做的事情无法发挥作用,那么我只是浪费了40多个小时的努力而失去了一个客户。 : - |

是否有人有任何聪明的解决方法或知道启用此操作的方法?请注意,在服务器端代码中使用EWS托管API目前不是此解决方案的选项。

1 个答案:

答案 0 :(得分:0)

Outlook不允许加载项按设计创建或更新FAI消息。通常,我们不允许直接修改OWA选项(或任何其他“服务类型”,内部,项目/数据),这可能是一个内部数据结构,可能会发生变化并可能破坏加载项。

如果您的方案特别需要访问Outlook的签名系统,我建议您向UserVoice

提出请求