Outlook web add-in on MAC, Office.context.mailbox.makeEwsRequestAsync not working

254 Views Asked by At

I'm current working on a outlook web add-in project, There is an makeEwsRequestAsync that I'm using to get item data and send email, but not it not working any more on outlook client on MAC.

I had test this API in Jan 2019, and this API works fine on outlook on mac, and other platform. but from this week I test it again, but seems it not executing any more, only on outlook client on mac, The callback method(callbackReadItem) is never be called any more, on other platform the api works fine, since it's a desktop application that I can't debug the script, so I just write some debug log through html, seem that the method makeEwsrequestAsync doesn't execute any more.

My code it's here

mailbox.makeEwsRequestAsync(getItemDataRequest(itemId), function (asyncResult) { callbackReadItem(asyncResult, callback) });

function callbackReadItem(asyncResult, callback) {
        $(".browerInfo").html("callbackReadItem");
        setTimeout(function () { alert("Hello"); }, 10000);
        var parser = new DOMParser();
        var xmlDoc = parser.parseFromString(asyncResult.value, "text/xml");
        //var xmlDoc = getXMLDocParser(asyncResult.value);
        var aaa = xmlDoc.getElementsByTagName('t:ItemId');
        changeKey = $(aaa).attr('ChangeKey');        
        setTimeout(function () { alert("Hello"); }, 10000);
        callback(itemId, $(aaa).attr('ChangeKey'));      
    }
function getItemDataRequest(itemId) {
        var soapToGetItemData = '<?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>' +
                        '    <GetItem' +
                        '                xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"' +
                        '                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">' +
                        '      <ItemShape>' +
                        '        <t:BaseShape>IdOnly</t:BaseShape>' +
                        '        <t:AdditionalProperties>' +
                        '            <t:FieldURI FieldURI="item:Attachments" /> ' +
                        '        </t:AdditionalProperties> ' +
                        '      </ItemShape>' +
                        '      <ItemIds>' +
                        '        <t:ItemId Id="' + itemId + '"/>' +
                        '      </ItemIds>' +
                        '    </GetItem>' +
                        '  </soap:Body>' +
                        '</soap:Envelope>';
        return soapToGetItemData;
    }

Does any one know what I have missed? or is there a bug on the outlook on mac for Outlook web add-in. Or if there is other way to do this.

Version of Outlook on MAC 16.23.1(190326) The One works before 16.21(190115)

Thanks

0

There are 0 best solutions below