2014-07-18 123 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

相关问题