Welcome to MSDN Blogs Sign in | Join | Help

GWS Application: Part 2

Let's ask Groove for a list of accounts, identities, and workspaces, and display them in our form.

A groove account contains one or more identities, which are alternate names for the same user.  You can create multiple identities, to appear with different names in different workspaces.  (This is one of Groove's very-little-used features; I don't know anyone who actually uses multiple identities regularly.  But it means that your workspaces are each tied to the identity, not the account).

Having added the GWS web references to our project, it's quite easy to ask Groove for the list of accounts, which returns an array including the list of identities for each account:

// Create an instance of the GrooveAccounts web service proxy class to call Groove

GrooveAccounts accountsService = new GrooveAccounts();

accountsService.GrooveRequestHeaderValue = new GrooveAccountsWebService.GrooveRequestHeader();

accountsService.GrooveRequestHeaderValue.GrooveRequestKey = "SECRET KEY GOES HERE";

accountsService.Url = "http://localhost:9080/GWS/Groove/2.0/Accounts";

// Read the list of Groove accounts

Account[] accounts = accountsService.Read();

foreach( Account a in accounts )

{

foreach( Identity i in a.Identities )

{

// Do something with the identity (display it in a combobox, for example).

}

}

One of the properties on the Identity i is Spaces, which is a string: the URL of the Spaces web service, which we can call to read the list of workspaces for this identity (and to create new workspaces, rename, export spaces as archive, and so on).

Two problems with the code so far.  First, there's a secret key we don't know about;  second, that URL is hard-coded to port 9080, and that's not a safe assumption (the port may change).  Now, I only want to do this once, but it'll take a whole post to cover properly.  Up next.

Published Tuesday, July 26, 2005 8:51 AM by hpyle
Filed under:

Comments

# GWS Application: See It Run!

Monday, August 15, 2005 9:59 AM by hughpyle
Having covered the security pre-requisites, we can build an application which actually runs.
In Part...

# Furthur!

Friday, September 09, 2005 3:39 PM by hughpyle
Here's a recap and subject-index of the story so far.

Getting started with Groove Forms; the component...

# Furthur!

Friday, September 09, 2005 3:40 PM by hughpyle
Here's a recap and subject-index of the story so far.

Getting started with Groove Forms; the component...
Anonymous comments are disabled
 
Page view tracker