2012-11-26 3 views
2

약속에 필요한 참석자 인 방의 ResponseType을 가져 오는 중 문제가 발생했습니다. Exchange 2010 sp2 ru4 서버가 미팅을 즉시 승인하거나 거절한다는 것을 확인할 수 있지만 프로그램 적으로 ExchangeManaged API로 약속을 지었을 때 필요한 참석자는 항상 ResponseType에 대해 "알 수 없음"값을 반환합니다.Attendee.ResponseType 알 수 없음 - Exchange 관리 API

여기 내 코드의 ...

public bool IsAppointmentVerifiedWithResource(Patron userSessionObj, Reservation reservation) 
    { 
     var emailConfig = new DataStoreManager.ConfigurationManager(); 
     var serviceBinding = emailConfig.GetConfiguration(Configuration.GetConfigurationName(Resource_ConfigurationConstants.ExchangeServiceBinding)); 

     // Create the binding. 
     var service = new ExchangeService(ExchangeVersion.Exchange2010_SP2) 
     { 
      UseDefaultCredentials = true, 
      Url = new Uri(serviceBinding) 
     }; 

     // Set the calendar view to use 
     var view = new CalendarView(reservation.Start, reservation.End); 

     // Get the target folder ID using the email address 
     var folder = new FolderId(WellKnownFolderName.Calendar, new Mailbox(reservation.EmailAddress)); 

     view.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties); 

     if (CheckForApptCount(service, folder, view)) 
     { 
      var response = service.FindAppointments(folder, view); 

      service.LoadPropertiesForItems(from Item item in response select item, BasePropertySet.FirstClassProperties); 

      foreach (Appointment apt in response.Items) 
      { 
       foreach(Attendee at in apt.RequiredAttendees) 
       { 
        //room mailbox matches required attendee 
        if(at.Address == reservation.EmailAddress) 
        { 
         ******at.ResponseType always = Unknown****** 
         if(at.ResponseType == MeetingResponseType.Accept) 
         { 
          return true; 
         } 
        } 
       } 
      } 

     } 

     return false; 

    } 

ResponseType 속성 동기화 및로드하는 방법에 어떤 아이디어?

감사합니다, 크리스

******************* UPDATE - 찾아 내기 주최자 약속 ************** *****

public List<Appointment> RetrieveExistingReservations(DateTime selectedDate) 
      { 
       var service = new ExchangeService() 
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");     

using (WindowsIdentity.Impersonate(service.ImpersonatedUserId)) 
       { 
        return EwsWrapper.GetStandardCalendarItems(service, selectedDate, selectedDate.AddDays(30)); 
       } 
      } 

      public static List<Appointment> GetStandardCalendarItems(ExchangeService service, DateTime dtStart, DateTime dtEnd) 
      { 
       // Instantiate a collection to hold occurrences and exception calendar items. 
       List<Appointment> foundAppointments = new List<Appointment>(); 

       // Initialize values for the start and end times, and the number of appointments to retrieve. 
       DateTime startDate = dtStart.AddDays(-1); 
       DateTime endDate = startDate.AddDays(30); 

       //// Create a calendar view to search the calendar folder and specify the properties to return. 
       CalendarView calView = new CalendarView(startDate, endDate) 
       { 
        PropertySet = new PropertySet(BasePropertySet.FirstClassProperties) 
       }; 

       // Retrieve a collection of calendar items. 
       FindItemsResults<Appointment> findResults = service.FindAppointments(WellKnownFolderName.Calendar, calView); 

       // Add all calendar items in your view that are occurrences or exceptions to your collection. 
       foreach (Appointment appt in findResults.Items) 
       { 


        foundAppointments.Add(appt); 

       } 

       return foundAppointments; 
      } 

답변

0

해결 FOUND : 나는 참석자의 사서함에 대해 "findappointments"을하고 다음이 참석자의 ResponseType를 얻기 위해 시도했기 때문에 참석자의 ResponseType는 항상 null이었다. 참석자의 ResponseType을 가져 오는 올바른 방법은 이끌이 사서함에 대해 "findappointments"를 실행하는 것입니다. 약속을 찾으면 참석자를 열거하고 ResponseType을 사용할 수 있습니다.

+0

주최자의 사서함에 대한 검색 약속은 어떻게 받습니까? –

+0

위의 "업데이트"참조 – foxtrotZulu