0

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

  • Check out comments in [this question](https://stackoverflow.com/questions/55172557/office-js-web-addin-failing-to-expanddl-with-soap-call) EWS request has a bug in 16.23 version of Mac and it is fixed in later builds. – SureshGowtham S Apr 08 '19 at 15:04
  • Thanks a lot @SureshGowthamS, it's good to know. The reason why we want to use the EWS request is we want to send the current email out in our add-in. from days of researching I have used the exchange rest API to send the email in the js instead of calling EWS request in the js. but still really thankful your kindly comment. – Jason.Jiang Apr 09 '19 at 07:38

0 Answers0