gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 10:26:37 24 4
gpt4 key购买 nike

我有一种方法可以从 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服务启用trace listener进行调试

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# - 交换 Web 服务 : BindToItems method returning error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31406770/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com