Exchange Web服务:BindToItems方法返回错误 [英] Exchange Web Service: BindToItems method returning error

查看:112
本文介绍了Exchange Web服务:BindToItems方法返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a method which pulls appointments from the Exchange calendar. The BindToItems method, which is currently pulling appointment from six months ago until six months in the future, fails with certain windows of time. It will pull some appointments but reports an error (no more details are given). Is there a way to see more details about the error, or does anyone see any problems with my code (below).

// 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服务启用跟踪侦听器以进行调试

You can enable trace listener for the ews service for debugging

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

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

You can find more on these links

  1. 启用跟踪和记录EWS
  2. 跟踪EWS请求
  1. Enabling tracing and logging EWS
  2. Tracing EWS request

这篇关于Exchange Web服务:BindToItems方法返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆