我正在开发一个项目,用于将特定Exchange用户的日历项目同步到另一个应用程序并返回。在另一个应用程序中也有会议。我在项目的几个部分中遇到的问题是,我希望将与会者添加到约会中,然后使用与会者的凭据进行约会并接受它。但是当我想在更新约会后立即检查绑定新约会时,文件夹中没有包含iCalUid的Item。当我等待2000ms更新会议请求后,但我不认为这是最佳做法。我有一个简短的代码示例:
string attendeeAddress = "mymailaddress";
ExchangeService service =
new ExchangeService(ExchangeVersion.Exchange2013)
{
Url = new Uri("https://exchange.sample.de/EWS/Exchange.asmx"),
Credentials = new WebCredentials("username", "password", "domain")
};
Appointment app = Appointment.Bind(service, id);
app.RequiredAttendees.Add(attendeeAddress);
app.IsResponseRequested = false;
app.Update(ConflictResolutionMode.AutoResolve);
CalendarView view = new CalendarView(app.Start, app.End);
Thread.Sleep(2000);
FindItemsResults<Appointment> attendeeApps =
serviceAttendee.FindAppointments(WellKnownFolderName.Calendar, view);
Appointment appAttendee;
foreach (Appointment a in attendeeApps)
{
if (a.ICalUid.Equals(app.ICalUid))
{
appAttendee = Appointment.Bind(serviceAttendee, a.Id);
}
}
appAttendee.Accept(false);
答案 0 :(得分:1)
从您将参与者添加到会议中然后连接到与会者邮箱以接受该会议的外观?如果是后端的情况,则会产生会议邀请,需要通过电子邮件发送,并通过集线器传输角色路由到参加者邮箱。即使所有收件人和服务器角色都在同一台服务器上,您也需要留出时间将邮件传递给与会者邮箱,这只是Exchange处理本地(或远程与会者)会议的正常方式,它永远不会是即时的因为Exchange将每个Appointment副本存储为单独的商店Item。