Share via


Testing for Groove Web Services Version 2.1

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

Before calling any of the operations provided in Groove Web Services Version 2.1, your application should test whether these features are present. Because Groove Web Services Version 2.1 was first provided as a hotfix to SharePoint Workspace 2010, it is important to explicitly check the Groove Web Services version numbers instead of checking the application version number.

Getting the Groove Web Services Versions

The GroovePropertiesRead operation returns the application version number and the Groove Web Services version information. The Groove Web Services version information is returned as an array of version numbers.

If your application calls an operation included in Groove Web Services Version 2.1 without checking for the presence of the version, it may generate an exception when the program is running.

Example Code: Testing for Groove Web Services Version 2.1

The following example code calls GrooveProperties.Read operation and tests the returned GrooveWebServicesVersions for the array element that has the value 2.1.

// Test if Groove Web Services Version 2.1 is present on system
GrooveProperties.GrooveProperties propsSvc = new GrooveProperties.GrooveProperties();
propsSvc.GrooveRequestHeaderValue = new GrooveProperties.GrooveRequestHeader();

// Get the identity from GrooveAccounts.Read2()
propsSvc.GrooveRequestHeaderValue.GrooveIdentityURL = // ...

// Get the request key, HTTP address, and port number.
string requestKey = //...
string HTTPAddressAndPort = //...

propsSvc.GrooveRequestHeaderValue.GrooveRequestKey = requestKey;

propsSvc.Url = HTTPAddressAndPort + "/GWS/Groove/2.0/Properties/";
GrooveProperties.Properties props = propsSvc.Read();
foreach (GrooveProperties.Version version in props.WebServicesVersions)
{
  if ((version.Major == 2) & (version.Minor == 1))
    return true;
}
// The array did not contain 2.1. Groove Web Services V 2.1 is not present on system
return false;

See Also

Reference

GrooveProperties.Read Operation

Concepts

Accessing Workspaces Exclusively Through Web Services