1

我正在开发一个网络平台,并且正在与 AD 和 Exchange Web 服务建立连接。

对于 Exchange,我将 PHP-EWS jamesiarmes / php-ews库与 Symfony 4.1 一起使用。

我目前正在订阅日历事件和日志通知的推送通知。

要订阅,我使用以下代码:

$eventTypes = new NonEmptyArrayOfNotificationEventTypesType();
$eventTypes->EventType[] = NotificationEventTypeType::CREATED_EVENT;
$eventTypes->EventType[] = NotificationEventTypeType::MODIFIED_EVENT;
$eventTypes->EventType[] = NotificationEventTypeType::DELETED_EVENT;
$eventTypes->EventType[] = NotificationEventTypeType::COPIED_EVENT;
$eventTypes->EventType[] = NotificationEventTypeType::MOVED_EVENT;

$folderIDs = new NonEmptyArrayOfBaseFolderIdsType();
$folderIDs->DistinguishedFolderId = new DistinguishedFolderIdType();
$folderIDs->DistinguishedFolderId->Id = DistinguishedFolderIdNameType::CALENDAR;

$pushSubscription = new PushSubscriptionRequestType();
$pushSubscription->FolderIds = $folderIDs;
$pushSubscription->EventTypes = $eventTypes;
$pushSubscription->StatusFrequency = $this->statusFrequency;
$pushSubscription->URL = $this->subscriptionUrl;

$subscribe_request = new SubscribeType();
$subscribe_request->PushSubscriptionRequest = $pushSubscription;

正如您在下面看到的那样,当我标记会议(例如)时,我收到了应有的通知,但 ItemId 或 ParentFolderId 为空!我究竟做错了什么?在日历中创建会议时如何接收这些字段?

{
      "SubscriptionId": "xxxxxxxx",
      "PreviousWatermark": "xxxxxxxx",
      "MoreEvents": "false",
      "CreatedEvent": {
        "Watermark": "xxxxx",
        "TimeStamp": "2018-08-13T13:18:12Z",
        "ItemId": "",
        "ParentFolderId": ""
      },
      "ModifiedEvent": [
        {
          "Watermark": "xxxxxxx",
          "TimeStamp": "2018-08-13T13:18:13Z",
          "ItemId": "",
          "ParentFolderId": ""
        },
        {
          "Watermark": "xxxxxxx",
          "TimeStamp": "2018-08-13T13:18:13Z",
          "FolderId": "",
          "ParentFolderId": ""
        }
      ]
    }
4

0 回答 0