问题描述
我正在使用makeEwsRequestAsync来获取电子邮件的完整MIME内容.但是,根据响应中的错误消息,响应大小似乎限制为1 MB:
"ErrorMessage":响应超过1 MB的大小限制.请修改您的EWS请求."
I'm using makeEwsRequestAsync to get the full MIME content of the email. But it looks like response size is capped at 1 MB, per the error message in the response:
"ErrorMessage":"Response exceeds 1 MB size limit. Please modify your EWS request."
<GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:MimeContent"/>
</t:AdditionalProperties>
</ItemShape>
<ItemIds><t:ItemId Id="' + itemId + '"/></ItemIds>
</GetItem>
我需要获取可能超过1 MB的邮件的MIME内容,并将此类内容发布到我们的服务器.有什么方法可以增加请求中的限制,或者在Exchange端进行配置?
I need to get MIME content of messages which may exceed 1 MB, and also POST such content to our server. Is there any way to increase this limit in the request, or configure this on the Exchange side?
推荐答案
不可能向客户端发出超过1 MB的EWS请求,但是您可以向服务器提供它自己进行请求所需的信息.
It is not possible to make EWS requests to the client side that exceed 1 MB, however you can give your server the information that it needs to make the request itself.
您首先需要致电Office.context.mailbox.getCallbackTokenAsync
,这将为您提供一个令牌,您可以使用该令牌从服务器发出EWS请求.
You first need to call Office.context.mailbox.getCallbackTokenAsync
which will give you a token you can use to make EWS requests from your server.
然后,您将需要获取通过Office.context.mailbox.item.itemId
可用的商品ID.
Then you will need to get the item ID which is available through Office.context.mailbox.item.itemId
.
最后,您需要向其发出请求的URL,即Office.context.mailbox.ewsUrl
Finally, you need the url to make the request to, which is Office.context.mailbox.ewsUrl
利用这3条信息,您的服务器可以从后端对EWS进行SOAP调用,并绕过对客户端施加的1 MB限制.此时,您可以将所需的任何信息传递回客户.
With these 3 pieces of information, your server can make the SOAP call to EWS from your backend, and bypass the 1 MB limit imposed on the client. At this point, you can pass whatever information needed back to your client.
这篇关于Outlook Web加载项的响应大小限制为1 MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!