简体   繁体   中英

Exchange Web Services - Create appointment with resource but attendees cannot see resource

I'm trying to play around with Exchange in order to integrate a room booking system with it.

I've created a room mailbox and have set it so that it auto-accepts appointment requests.

When creating an appointment as a standard user I can add the room as a resource and its availability will display. If I book it then it books successfully.

I've created an appointment via Exchange Web Services with room as a resource. The resource was successfully booked (as confirmed when opening it as the room's delegate) but it does not appear on the meeting as viewed by any of the attendees.

        var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1) {
            Credentials =
                new NetworkCredential("username", "password", "domain"),
            Url = new Uri("https://myexchangeserver.co.uk/EWS/Exchange.asmx")
        };

         var appointment = new Appointment(service)
                              {
                                  Subject = "Created by ExchangeTest app",
                                  Body = "Some body text....",
                                  Start = startTime,
                                  End = endTime
                              };
        appointment.RequiredAttendees.Add("AnAttendee@myexchangeserver.co.uk");
        appointment.Resources.Add("ARoom@myexchangeserver.co.uk");
        appointment.Save(SendInvitationsMode.SendOnlyToAll);

Any ideas as to why it's not displaying as it would if I'd booked it manually?

As a side note I'm not actually able to view the calendar for this room as any user other than a delegate for it; it says the folder cannot be found.

I'm not totally sure about your main problem.

About the side note though:

Have you tried searching your appointments?

FolderId folder = new FolderId(WellknownFolderName.Calendar,"test@test.com");
CalendarView calendarView = new CalendarView(startDate, endDate);

foreach (Appointment exchangeAppointment in service.FindAppointments(folder, calendarView))
{
    // Here you should be able to get access on the appointments at the specified folder & address
}

Maybe you could try to manually create the meeting and then bind to it. Doing so you should be able to browse the object and check what the differences with yours are?

var appointment = Appointment.Bind(service, new ItemId("yourmeetingid"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM