c# - 交换网络服务 : BindToItems method returning error

标签 c# exchangewebservices

我有一种从 Exchange 日历中提取约会的方法。 BindToItems 方法当前正在将预约从六个月前拉到 future 六个月,但在某些时间窗口内会失败。它将提取一些约会,但报告错误(未给出更多详细信息)。有没有办法查看有关错误的更多详细信息,或者有人看到我的代码有任何问题(如下)。

// Set the start and end time and number of appointments to retrieve.
Microsoft.Exchange.WebServices.Data.CalendarView cView = new Microsoft.Exchange.WebServices.Data.CalendarView(startDate, endDate, 1000);

// Limit the properties returned to the appointment's subject, start time, and end time. 
cView.PropertySet = new PropertySet(BasePropertySet.IdOnly);

// Retrieve a collection of appointments by using the calendar view.
FindItemsResults<Appointment> currApp = calendar.FindAppointments(cView);

 cView.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
 cView.PropertySet.RequestedBodyType = BodyType.Text;
 ServiceResponseCollection<GetItemResponse> apps = service.BindToItems(currApp.Select(r => r.Id), cView.PropertySet);

最佳答案

您可以为 ews 服务启用跟踪监听器以进行调试

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.TraceListener = ITraceListenerInstance;
service.TraceFlags = TraceFlags.EwsRequest | TraceFlags.EwsResponse
service.TraceEnabled = true;

您可以在这些链接上找到更多信息

  1. Enabling tracing and logging EWS
  2. Tracing EWS request

关于c# - 交换网络服务 : BindToItems method returning error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31406770/

相关文章:

c# - 使用 EWS 托管 API 创建文件夹或打开它(如果存在)

c# - 循环集合中除新行之外的每一行。

c# - 在 ASP.NET 成员资格中向用户分配帖子

c# - 通过网络发送 C# 程序集/DLL?

c# - 互操作词动态表创建

soap - Exchange Server 2016 的 ServerVersionInfo 元素中的版本属性名称?

c# - 如何在 javascript 和 ASP.NET 中返回项目的当前域?

Java EWS findappointments 日期表现得很奇怪,要么返回很多,要么什么也没有

php - 如何通过 Exchange Web 服务访问日历事件的 session 请求? (以及 PHP 和 SOAP)

c# - 使用 EWS 按路径获取 Exchange 文件夹