none
makeEwsRequestAsync function in Outook 2016 Windows Desktop Client doesn't work RRS feed

  • Question

  • I'm developing outlook addin, and need to use makeEwsRequestAsync to create appointment in user's EWS. I tested in multiple combinations such as Mac/Windows, Chrome/Firefox, Office365/Exchange etc. However, only in Outlook 2016 for Windows + Exchange Server 2013 account doesn't work. 
    Has anyone meet with this issue also? How can I solve this issue?

    Thanks very much!

    Friday, November 4, 2016 11:11 PM

All replies

  • Hi TonyXu,

    Could you share us your code and xml request? What is your Outlook 2016 version? I made a test with below code under Outlook desktop 16.0.7329.1017 32-bit, it works correctly.

      function MeetingRequest()
      {
          var result = '<?xml version="1.0" encoding="utf-8"?>' +
                  '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
                                         ' 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>' +
              '<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"' +
                           ' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"' +
                            ' SendMeetingInvitations="SendToAllAndSaveCopy" >' +
          '<SavedItemFolderId>' +
          '<t:DistinguishedFolderId Id="calendar"/>' +
          '</SavedItemFolderId>' +
          '<Items>' +
          '<t:CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types">' +
            '<Subject>Planning Meeting</Subject>' +
            '<Body BodyType="Text">Business meeting about new customers.</Body>' +
            '<ReminderIsSet>true</ReminderIsSet>' +
            '<ReminderMinutesBeforeStart>60</ReminderMinutesBeforeStart>' +
            '<Start>2016-12-02T14:00:00</Start>' +
            '<End>2016-12-02T15:00:00</End>' +
            '<IsAllDayEvent>false</IsAllDayEvent>' +
            '<LegacyFreeBusyStatus>Busy</LegacyFreeBusyStatus>' +
            '<Location></Location>' +
            '<RequiredAttendees>' +
              '<Attendee>' +
                '<Mailbox>' +
                  '<EmailAddress>xxx@microsoft.com</EmailAddress>' +
                '</Mailbox>' +
              '</Attendee>' +
            '</RequiredAttendees>' +
          '</t:CalendarItem>' +
          '</Items>' +
          '</CreateItem>' +
          '</soap:Body>' +
          '</soap:Envelope>';
          return result;
      }
      function callback(asyncResult) {
          var result = asyncResult.value;
          var context = asyncResult.context;
          console.log(asyncResult.status);
      }
      function CreateMeeting() {
          Office.context.mailbox.makeEwsRequestAsync(MeetingRequest(), callback);
    
      }

    I suggest you make a test with my above code.

    Best Regards,

    Edward

         

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 7, 2016 8:03 AM
  • app.createMeetingInExchange = function(meetData, emails, agenda, start, end, callback) {
            var soapRequest = createAppointment(meetData, emails, agenda, start, end);
            Office.context.mailbox.makeEwsRequestAsync(soapRequest, callback);
    
        }
    function createAppointment(meetData, emails, agenda, start, end) {
    
            var attendies = "";
            emails.split(",").forEach(function(email) {
                attendies = attendies + '<Attendee>' +
                    '<Mailbox>' +
                    '<EmailAddress>' + email + '</EmailAddress>' +
                    '</Mailbox>' +
                    '</Attendee>';
            });
            console.log("Emails in Tags = " + attendies);
    
            var result = '<?xml version="1.0" encoding="utf-8"?>' +
                '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
                ' 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>' +
                '<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"' +
                ' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"' +
                ' SendMeetingInvitations="SendToAllAndSaveCopy" >' +
                '<SavedItemFolderId>' +
                '<t:DistinguishedFolderId Id="calendar"/>' +
                '</SavedItemFolderId>' +
                '<Items>' +
                '<t:CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types">' +
                '<Subject>' + meetData.data.binder_name + '</Subject>' +
                '<Body BodyType="HTML">' + agenda + '</Body>' +
                '<ReminderIsSet>true</ReminderIsSet>' +
                '<ReminderMinutesBeforeStart>60</ReminderMinutesBeforeStart>' +
                '<Start>' + start.toISOString() + '</Start>' +
                '<End>' + end.toISOString() + '</End>' +
                '<IsAllDayEvent>false</IsAllDayEvent>' +
                '<LegacyFreeBusyStatus>Busy</LegacyFreeBusyStatus>' +
                '<Location>' + meetData.data.startmeet_url + '</Location>' +
                '<RequiredAttendees>' +
                attendies +
                '</RequiredAttendees>' +
                '</t:CalendarItem>' +
                '</Items>' +
                '</CreateItem>' +
                '</soap:Body>' +
                '</soap:Envelope>';
            return result;
        }

    Tuesday, November 29, 2016 12:55 AM
  • And, the version is Outlook 2016 MSO (16.0.7329.1017) 32-bit. Please also notice that only Exchange Server 2013 have this problem, Exchange Server 2016 works fine.


    Tuesday, November 29, 2016 1:02 AM
  • Hi TonyXu_US,

    Thanks for detailed information. I checked my Exchange Server version and it is 2016. I do not have Exchange Server 2013 to make a test. It seems it is related with Exchange Server version. I would suggest you install the latest update for Exchange Server 2013.

    # Exchange Server 2013 and 2016 Build Numbers (with Cumulative Updates)

    https://social.technet.microsoft.com/wiki/contents/articles/15776.exchange-server-2013-and-2016-build-numbers-with-cumulative-updates.aspx

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 29, 2016 7:43 AM
  • Thanks Edward,

    By the way, the return I got is 

    {"value":null,"status":"failed","error":{"name":"GenericResponseError","message":"The operation failed.","code":9020}}

    Where can I check what this error mean? Thanks very much!

    <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333; background-color: #d5ebfd} span.s1 {font-kerning: none} table.t1 {border-collapse: collapse} td.td1 {width: 293.0px; padding: 1.0px 1.0px 1.0px 1.0px} </style>
    Tuesday, November 29, 2016 7:06 PM
  • Hi TonyXu_US,

    This is a general error.

    To check whether it is specific issue to Office Add ins, I suggest you try to create an appointment by using EWS.

    # Create an appointment by using EWS
    https://msdn.microsoft.com/en-us/library/office/dn495611(v=exchg.150).aspx

    In addition, Due to the limitation of the community support channel, I afraid we are not able to troubleshoot this issue in an unreproducible environment. I will suggest you contacting the Microsoft professional support so that our engineers can work closely with you to troubleshoot this issue.

    If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. Please visit the below link to see the various paid support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 30, 2016 2:41 AM