У меня проблема: не удается получить тело встречи, если оно было создано клиентом outlook365.Когда я запускаю код, все значения свойств принимаются, кроме тела.
После некоторого поиска я обнаружил, что тела назначения не принимаются, если назначения были сделаны outlook365.Пожалуйста, помогите!
Код:
public static List<Appointment> SetupConnection()
{
ServicePointManager.ServerCertificateValidationCallback = CallbackMethods.CertificateValidationCallBack;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.Credentials = new WebCredentials("Someuser@somedomain.com", "SomePassword");
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
Folder calendarFolder = GetCalendarFolder(service, @"\");
return GetMeetings(calendarFolder, service);
}
public static List<Appointment> GetMeetings(Folder calendarFolder, ExchangeService service)
{
if (calendarFolder == null)
{
return null;
}
SearchFilter.SearchFilterCollection filters = new SearchFilter.SearchFilterCollection(LogicalOperator.And)
{
new SearchFilter.IsGreaterThan(AppointmentSchema.Start, DateTime.Today)
};
List<Appointment> meetings = new List<Appointment>();
const Int32 pageSize = 30;
ItemView itemView = new ItemView(pageSize);
PropertySet propertySet = new PropertySet(BasePropertySet.IdOnly);
itemView.PropertySet = propertySet;
FindItemsResults<Item> findResults = null;
do
{
findResults = calendarFolder.FindItems(filters, itemView);
itemView.Offset += pageSize;
meetings.AddRange(findResults.Cast<Appointment>());
} while (findResults.MoreAvailable);
PropertySet propertySet1 = new PropertySet(BasePropertySet.IdOnly);
propertySet1.Add(ItemSchema.Body);
propertySet1.Add(ItemSchema.Subject);
propertySet1.Add(AppointmentSchema.Organizer);
propertySet1.Add(AppointmentSchema.Start);
propertySet1.Add(AppointmentSchema.End);
propertySet1.Add(AppointmentSchema.Duration);
propertySet1.Add(AppointmentSchema.AppointmentType);
propertySet1.Add(AppointmentSchema.ConferenceType);
propertySet1.Add(AppointmentSchema.IsOnlineMeeting);
propertySet1.Add(AppointmentSchema.IsMeeting);
propertySet1.Add(AppointmentSchema.IsRecurring);
propertySet1.Add(AppointmentSchema.HasAttachments);
propertySet1.Add(AppointmentSchema.RequiredAttendees);
propertySet1.Add(AppointmentSchema.Resources);
propertySet1.Add(AppointmentSchema.InternetMessageHeaders);
propertySet1.RequestedBodyType = Microsoft.Exchange.WebServices.Data.BodyType.Text;
service.LoadPropertiesForItems(meetings, propertySet1);
return meetings;
}
}