如何使用EWS托管API StreamingSubscriptionConnection [英] How to use the EWS managed API StreamingSubscriptionConnection

查看:66
本文介绍了如何使用EWS托管API StreamingSubscriptionConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在尝试使用StreamingSubscriptionConnection,但无法找到有关此主题的任何帮助。存在"SubscribeToStreamingnotifications"和"SubscribeToStreamingnotifications"。关于ExchangeService对象的方法,但是如何将它与StreamingSubscriptionConnection一起用于
get事件?

I'm trying to use the StreamingSubscriptionConnection, but can't find any help on this topic. There is a "SubscribeToStreamingnotifications" method on the ExchangeService object, but how do I use this together with the StreamingSubscriptionConnection to get events?

 

推荐答案

您好,

您需要先致电 SubscribeToStreamingNotifications 来订阅流媒体通知。这将返回
StreamingSubscription 对象。然后,您需要一个  StreamingSubscriptionConnection 的实例,您可以通过调用
AddSubscription 添加以前创建的订阅。然后连接连接的 OnNotificationEvent
OnDisconnect OnSubscriptionError 事件,并通过调用
打开连接打开。 当通知可用时,将异步调用OnNotificationEvent处理程序。请注意,这将发生在另一个线程上(据我记得)。

You need to first subscribe to streaming notifications by calling SubscribeToStreamingNotifications. This will return a StreamingSubscription object. Then you need an instance of a StreamingSubscriptionConnection, to which you can add the previously created subscription by calling AddSubscription. Then hook up the connection's OnNotificationEvent, OnDisconnect and OnSubscriptionError events, and open the connection by calling Open. Your OnNotificationEvent handler will be called asynchronously when notifications are available. Note that this will happen on a different thread (as far as I remember).

您可以向单个连接添加多个流式订阅。这使您可以通过单个连接从多个邮箱接收事件。

You can add multiple streaming subscriptions to a single connection. This lets you receive events from multiple mailboxes through a single connection.


这篇关于如何使用EWS托管API StreamingSubscriptionConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆