none
[E2010SP1][EWS][C#] How can I verify that EWS is in fact creating a subcription? RRS feed

  • Question

  • Similar to an earlier question (http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/2417b410-eea4-4cf3-87c7-19ca57cdd219/) I am now wondering why I'm able to keep an active streaming connection to our server for several days but don't receive any event notifications.

    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
    _exchangeService.AutodiscoverUrl("myemail");
    
    var locateMailbox = new Mailbox
    {
    	Address = "myemail"
    };
    
    var folderId = new FolderId(WellKnownFolderName.Inbox, locateMailbox);
    var foldersToWatch = new[] { folderId };
    _streamingSubscription =
    	_exchangeService.SubscribeToStreamingNotifications(foldersToWatch, EventType.NewMail);
    
    _streamingSubscriptionConnection = new StreamingSubscriptionConnection(_exchangeService, 30);
    
    _streamingSubscriptionConnection.AddSubscription(_streamingSubscription);
    
    _streamingSubscriptionConnection.OnNotificationEvent += delegate { Console.WriteLine("event"); };
    _streamingSubscriptionConnection.OnSubscriptionError += delegate { Console.WriteLine("error"); };
    _streamingSubscriptionConnection.OnDisconnect += delegate { Console.WriteLine("disconnect"); };
    
    _streamingSubscriptionConnection.Open();
    

    I'm assuming I'm subscribing successfully or else I'd receive an error.

    Where can I find where my notifications are going?

    Thursday, May 19, 2011 6:11 PM

All replies

  • michaelc.h1,

    You can view the ActiveSubscription performance counter if you have access to the Exchange Server. I believe there are other performance counters that identify the number of requests and repsonses. This way you can at least see the subscriptions active on the server.

    With regards,


    Michael | Microsoft Exchange SDK

    The Exchange Development Forum Guide has useful information for using the Exchange Development Forum.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, May 26, 2011 8:36 PM
    Moderator