How to use the EWS managed API StreamingSubscriptionConnection RRS feed

  • Question

  • Hi!

    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?


    Thursday, November 4, 2010 8:16 AM

All replies

  • Hi,

    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.

    David Claux | Program Manager - Exchange Web Services
    Thursday, November 4, 2010 3:29 PM
  • Thanks!


    I was missing the call to Open!

    Thursday, November 4, 2010 7:12 PM