Reading Groove Web Services Events

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

You can monitor the queue in several ways. GrooveEvents.ReadSummary operation returns the queue's latest sequence number and list of event sources of events present in the queue. It is an efficient way to determine whether the queue contains any new events, and whether these are from sources of interest.

GrooveEvents.ReadExtended is used to get detailed information about events in the queue. It reads all events up to a specified sequence number, and can read events either destructively or non-destructively. The non-destructive option has been added to enhance robustness. Non-destructive reading allows you to re-read events if the operation fails for any reason. (Failure is a possibility because the web services protocols do not guarantee delivery.) Alternatively, you can use the GrooveEvents.Read operation to get event data. However Read does not have a non-destructive option, and does not work with sequence numbers, so it is primarily retained in the API for backward compatibility.

The GrooveEvents ReadExtended operation returns an events summary and zero or more event messages, as follows:

  • Event Queue Summary: provides information about the contents of the queue. The information includes the sequence number of the latest event and the last modified time, so that you can easily determine if the queue has changed since it was last read. It also includes an event count and an optional list of event sources. These can be inspected to determine if a detailed read is needed.

  • List of events: includes all events from the beginning to the specified sequence number. Each event includes the following information:

    • SubscriptionID: identifies the subscription. The SubscriptionID allows your application to associate the event with the subscription that listened for it.

    • Event Class: specifies the class of the event, such as "urn:groove-net:Forms3Event". Typically, each Groove Web Service has one event class.

    • Event Source: identifies the Web service that emits the event. Typically, this is the Source URI that was specified in the subscription.

    • Event Type: identifies the kind of event, such as Forms2RecordAddEventData.

    • Event Data: the data specific to the Event Type. The class of this element is a subclass of the EventData class. Your application uses the information in the EventType element to cast or convert the Event Data element to the appropriate subclass. For example, if the EventType is ContactDeleteEventData, your application converts it to the appropriate type and then accesses the fields of that subclass. The SOAP API Reference pages describe the content of the EventData subclass. In the case of ContactDeleteEventData, the subclass contains one element, which is named ContactURI.

If your application gets an SOAP exception when you read events, check that you have followed the instructions to add the GrooveEventData.cs or GrooveEventData.vb files to your project. See Creating Groove Web Services Projects in Visual Studio 2008 for more information.

See Also

Reference

GrooveEvents Web Service

GrooveSubscriptions Web Service

Concepts

Handling Groove Web Services Events