Risorse per professionisti IT > Home page del forum > Development > EWS Push Notification question
Formula una domandaFormula una domanda
 

Risposta suggeritaEWS Push Notification question

  • venerdì 7 dicembre 2007 0.57Jamie Lee Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I have several questions about Push Notification.

    1.  If I need to keep track of 1000 users' inbox, do I need to create 1000 bindings?  What's the Exchange Server's limit in bindings?

    2.  The Push Notification's "StatusFrequency" is an integer, does that mean the fastest notification I get is every minute?

    3.  After an event is received, what do we send back to the Exchange Server?

    4.  When we tear down the application, do we need to unsubscribe like the Pull Notification?

    5.  In the sample code below, we know what the ItemId is, and we probably need to call GetItem to find out what the item is.  But How do we know if the item is created, deleted, or new? 

        // Access event information for create, delete, or new mail events.
        public static void AccessCreateDeleteNewMailEvent(BaseObjectChangedEventType bocet)
        {
            // Get the watermark for the event.
            string watermark = bocet.Watermark;

            // Get the timestamp for the event.
            DateTime timestamp = bocet.TimeStamp;

            // Get the parent folder identifier.
            FolderIdType parentFolderId = bocet.ParentFolderId;

            // Get either the folder or item identifier for a
            // create/delete/new mail event.
            if (bocet.Item is ItemIdType)
            {
                // Get the item identifier.
                ItemIdType itemId = bocet.Item as ItemIdType;
            }
            else
            {
                // Get the folder identifier.
                FolderIdType folderId = bocet.Item as FolderIdType;
            }
        }


    Thanks in advance,

Tutte le risposte

  • mercoledì 2 settembre 2009 23.10Craig Campbell Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I just have been assigned to a project that is working with EWS. 

    I am asking these same questions, if there really is no response, where is a good place to look for answers to these questions?  I've been scouring the fourms and documentation and am still wondering.

    Thanks,
    Craig
    Craig Campbell
  • giovedì 3 settembre 2009 5.54Henning KrauseMVPMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Risposta suggerita
    Hi,

    <shameless advertising>
    If you wan to use push notifications, have a look at my listener on CodePlex (http://exchangenotification.codeplex.com). It implements the whole stuff and makes it a piece of cake to use notifications. It's also free and open source...
    </shameless advertising>

    1. Yes, you need a binding for each mailbox. I'm not aware of any limit, but it's certainly not around 1000.

    2. No. Exchange will send out notificatoins ASAP. The status-frequency is some sort of keep-alive system. If you don't get a notification for a specific subscriptions, Exchange will at least send a status notification saying "Hey, are you still listening?". You need to acknowledge this ping or the subscription will time out eventually. This status frequency can be from 1 minute to 1440 minutes (one day).

    3. If you wan to receive further notifications, send back an OK. If not, send back an unsubscribe response.

    4. No, you don't need. Exchange will try to send notifications to your listener and will eventually stop if it doesn't get any responses.

    5. The type of the eventargs is different. Have a look at my implementation at CodePlex in the Subscription.cs.


    Kind regards,
    Henning
  • lunedì 23 novembre 2009 13.52Costin Morariu Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi Henning,

    I was looking for an answer to a similar question like 1), "Is it possible to (push) subscribe for many mailboxes on the same binding?".

    First relevant info -> found was that having an binding to EWS with USER-X credentials I can access every mailbox if USER-X has appropriate rights. (Inside Microsoft Exchange Server 2008 WS - Chapter 2 (May I See Your Id) - Delegate access, page 41). This means for me that I do not need many bindings.

    Second relevant info -> found in the same book Chapter 17 (Notifications) - Other Mailboxes, page 669 "SyncFolderItems allows you to sync against another user's Mailbox. However, Notification works only for caller's Mailbox.". At this point I was troubled. This means for me that upper finding is not valid for Notifications and I may still need every subscription on its separate binding.

    Third relevant info -> the thread "Can you retrieve a list of users having their calendars updated since last enquiry" (http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/cb121603-97e2-4852-ab65-e5031d3d3a3a) from where the conclusion that subscribing for many mail boxes is OK.

    Now reading your answers (more precisely to question 1) from this thread I am confused.
    It would be great if you or anybody else can clarify this.

    Thanks,
    Costin
  • mercoledì 25 novembre 2009 0.27Andrew Salamatov - MSFT Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi Costin,

    What is the scenario that you are building for? Depending on the scenario, delegate access may or may not be (probably is not) the recommended approach.

    Thanks,
    -Andrew
  • sabato 2 gennaio 2010 1.57Costin Morariu Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi,

    Sorry for the late answer (notification alert of this thread was for some reasons failed to me:)).

    The scenario was to access many mailboxes calendar items as simple as it could be. Reading this and other threads + google-ing I choose to do it via Exchange impersonation. But I was initialy wondering if one binding and one subscription are enaugh to get notifications for all interested mailboxes.

    Reading stuff and testing by writing code is now clear for me that I need a subscription for every mailbox and since binding is going to be impersonated for every mailbox it would be wize choice to saved it in order to be able to get notification data out of Exchange.

    Thanks,
    Costin
  • mercoledì 6 gennaio 2010 0.01Andrew Salamatov - MSFT Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Yup - you're correct!

    -Andrew