1

I have a web page (ASP.Net) that displays multiple users calendar appointments. Currently I am fetching the data by making asynchronous calls to a web service that in turn calls the onsite EWS using code similar to:

        var userMailbox = new Mailbox("user1@example.com");
        var folderId = new FolderId(WellKnownFolderName.Calendar, userMailbox);

        DateTime startDate = DateTime.Now.Date;
        DateTime endDate = startDate.Date.AddDays(5);

        CalendarView cView = new CalendarView(startDate, endDate);
        cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End);

        var appointments = _Service.FindItems(folderId, cView);

        //Do something with results

This solution does work but is incredibly slow. Each call to the EWS takes approx 800ms complete. If I fire off 10 asynchronous requests, it would appear that EWS queues them up and deals with them one at a time, meaning that it takes approx 8 seconds to completely update a page with 10 mailboxes.

I am unable to change any aspect of the EWS configuration.

The bottleneck appears to be in the round trips to EWS rather than in the amount of data returned. With this in mind, is it possible to make a single call to EWS that can accept multiple folder ids and return calendar appointments for multiple users?

SausageFingers
  • 1,796
  • 5
  • 31
  • 52

0 Answers0