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 Microsoft Office Groove 2007, it is important to explicitly check the Groove Web Services version numbers instead of checking the Groove version number.
Getting the Groove Web Services Versions
The GrooveProperties Read operation returns the Groove 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