响应交换EWS

时间:2017-06-14 06:54:02

标签: c# exchangewebservices

我在新约会后如何得到答复?一个OK响应或不行,以及它的原因..?

认证后,这是我创建约会的代码

            DateTime bookingStart = new DateTime(2017, 6, 14, 14, 0, 0);
        DateTime bookingEnd = bookingStart.AddHours(2);
        Booking booking = new Booking()
        {
            Subject = "BookingTest",
            Start = bookingStart,
            End = bookingEnd,
            Room = "xxx.room@dummy.be",
            Person = "person@dummy.be"
        };
        //Meetingrequest aanmaken
        var request = new Appointment(service)
        {
            Subject = booking.Subject,
            Start = booking.Start,
            End = booking.End,
            Location = booking.Room
        };
        //Aanhangen wie wilt meedoen
        request.RequiredAttendees.Add(booking.Person);
        request.RequiredAttendees.Add(booking.Room);

        ServiceResponse response = service.CreateItems()

        request.Save(SendInvitationsMode.SendOnlyToAll);

但是这并没有给我一个对象。

1 个答案:

答案 0 :(得分:0)

保存此约会后,会议项目将获得唯一标识符。

request.Save(SendInvitationsMode.SendOnlyToAll);
var id = request.Id.UniqueId; 

保存标识符,稍后,您可以使用此标识符来跟踪会议响应,如此

Appointment meeting = Appointment.Bind(service, new ItemId(id));
for (int i = 0; i < meeting.RequiredAttendees.Count; i++)
{
    Console.WriteLine("Required attendee - " + meeting.RequiredAttendees[i].Address + ": " + meeting.RequiredAttendees[i].ResponseType.Value.ToString());
}

参考:Tracking meeting responses by using the EWS Managed API 2.0