问题
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>
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:
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.
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.
Then you will need to get the item ID which is available through Office.context.mailbox.item.itemId
.
Finally, you need the url to make the request to, which is Office.context.mailbox.ewsUrl
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.
来源:https://stackoverflow.com/questions/38489704/1-mb-response-size-limit-with-outlook-web-add-ins