2014-07-18 79 views
0

我是使用Exchange EWS的全新軟件,無法在文檔或在線中找到對此的任何參考。Exchange 2007 ews(Web服務) - 找出誰已經接受參加會議?

我正在連接到Exchange 2007服務器,並使用PHP SoapClient檢索給定帳戶的日曆會議列表。這是工作,並檢索所有的會議作爲CalendarItem對象,然後我可以在我的PHP腳本中使用。

但是,我真正需要的是知道誰有接受出席會議。我收集了CalendarItem對象的DisplayTo屬性告訴我們哪些人被邀請,但肯定其中一些人可能已經拒絕。所以,如果我想知道誰將在那裏,我怎麼能得到這些信息?

這似乎是有用的信息可用(例如計劃餐飲或其他),所以它似乎不可能通過Web服務公開,但我無法找到如何發現此信息。

任何人都可以幫忙嗎?

編輯:只是爲了澄清什麼是由Exchange 2007 Web服務返回,這是什麼服務回報每一次會議:

[0] => stdClass Object 
     (
      [ItemId] => stdClass Object 
       (
        [Id] => AAAQAHN0ZXBld0BNQkEuYWMud 
        [ChangeKey] => DwAAABYA 
       ) 

      [ParentFolderId] => stdClass Object 
       (
        [Id] => AQAQAHN0ZXBld0BNQkEuYWM 
        [ChangeKey] => AQ 
       ) 

      [ItemClass] => IPM.Appointment.Occurrence 
      [Subject] => IT Meeting 
      [Sensitivity] => Normal 
      [DateTimeReceived] => 2013-09-11T13:06:27Z 
      [Size] => 6724 
      [Importance] => Normal 
      [IsSubmitted] => 
      [IsDraft] => 
      [IsFromMe] => 
      [IsResend] => 
      [IsUnmodified] => 
      [DateTimeSent] => 2013-09-11T13:06:27Z 
      [DateTimeCreated] => 2013-09-11T13:06:27Z 
      [ReminderDueBy] => 2014-08-04T10:30:00Z 
      [ReminderIsSet] => 1 
      [ReminderMinutesBeforeStart] => 15 
      [DisplayCc] => 
      [DisplayTo] => Bob, Frank, Tim, Alf, Juanita 
      [HasAttachments] => 
      [Culture] => en-US 
      [Start] => 2014-06-02T10:30:00Z 
      [End] => 2014-06-02T12:00:00Z 
      [IsAllDayEvent] => 
      [LegacyFreeBusyStatus] => Busy 
      [Location] => Meeting Room 
      [IsMeeting] => 1 
      [IsRecurring] => 1 
      [MeetingRequestWasSent] => 
      [IsResponseRequested] => 1 
      [CalendarItemType] => Occurrence 
      [MyResponseType] => Accept 
      [Organizer] => stdClass Object 
       (
        [Mailbox] => stdClass Object 
         (
          [Name] => Bob 
         ) 

       ) 

      [Duration] => PT1H30M 
      [TimeZone] => (UTC) Dublin, Edinburgh, Lisbon, London 
      [AppointmentReplyTime] => 2013-09-11T13:07:00Z 
      [AppointmentSequenceNumber] => 0 
      [AppointmentState] => 3 
      [ConferenceType] => 0 
      [AllowNewTimeProposal] => 1 
      [NetShowUrl] => 
     ) 

回答

1

這個答案是一個試探性的解決方案,但它似乎工作據我所知。

因此,使用PHP的SOAPClient以獲得每個約會的約會細節,形成SOAP請求,如在原來的問題,我用的是以下幾點:

//Loop through each CalendarItem in the CalendarItems collection 
//Using a "by reference" pointer as I want to add the extra information to the original object. 
foreach($calendaritems as &$b){ 
    $NewSearch->Traversal = "Shallow"; 
    $NewSearch->ItemShape->BaseShape = "AllProperties"; 
    $NewSearch->ItemIds->ItemId = $b->ItemId; 
    $result = $client->GetItem($NewSearch); 

    //add the RequiredAttendees element to the original calendar item, just for convenience 
    $b->RequiredAttendees = $result->ResponseMessages->GetItemResponseMessage->Items->CalendarItem->RequiredAttendees; 
} 

然而,似乎就可以只查看會議請求的ResponseType,即您連接的帳戶是組織者。所有其他會議顯示爲「未知」作爲ResponseType。

+0

您需要有權查看其他人的日曆才能查看他們組織的會議的回覆。 –

1

您可以循環約會中的與會者,並檢查其響應類型是什麼。我已經爲您編寫了一個擴展的代碼塊來幫助您理解。我希望這可以幫助:)

Appointment existingAppointment; 

int acceptCount = 0; 

if (existingAppointment.RequiredAttendees.Count > 0) 
{ 
    foreach(Attendee att in existingAppointment.RequiredAttendees) 
    { 
     if ((att.ResponseType.HasValue) && (att.ResponseType.Value == MeetingResponseType.Accept)) 
     { 
      acceptCount++; 
     } 
    } 
} 
+0

嗨@Alex,謝謝你的幫助,但我對你的回答有點困惑。你在答案中使用某種形式的庫,因爲我只是使用PHP SOAP客戶端?除非我錯了,否則沒有任何PHP類約會,EWS響應日曆約會請求返回的對象沒有「RequiredAttendees」屬性。 – Ambulare

+0

看來你最近編輯了你的問題。我和@Mimi Gentz認爲你是用C#編程的。我不知道如何在PHP中做到這一點。對不起, –

+0

嗨@Alex,不,我的問題總是說PHP並被標記爲PHP。我編輯它以添加Web服務返回的數據的示例。不過,感謝您嘗試提供幫助。 – Ambulare

相關問題