1

我正在用 C# 开发一个概念验证网站站点,它将采用 URL 查询字符串,将其与特定的 Groove 工作区匹配,然后如果用户没有该空间,则邀请他们进入该空间。我有连接到 Groove 数据桥,找到工作区,阅读工作区成员部分工作得很好。

不过,我遇到了自动邀请的绊脚石。我将它作为一个独立的网站“桥”运行,所以我试图完全从 Web 服务器运行它。我有我想从数据库中邀请的人的 Groove 身份作为字符串:

CurrUserIdentity =grooveIdentity://nzkth68eqzgktrb9sbr....

但是,我不知道如何将字符串转换为真正的 GrooveMember.Member 对象,然后再被邀请。在这种情况下,最简单的邀请方式是什么?

4

2 回答 2

1

Groove Web Services V12 Helpers Library 可以提供更易于管理的 API 来完成该任务 - http://gwsv12helpers.codeplex.com/

于 2011-04-14T16:55:38.157 回答
1

终于找到了:

GrooveMembers.GrooveMembers AddMember = new GrooveMembers.GrooveMembers();
AddMember.GrooveRequestHeaderValue = new GrooveMembers.GrooveRequestHeader();
AddMember.GrooveRequestHeaderValue.GrooveRequestKey = someString; //Whatever used in your envronment
AddMember.GrooveRequestHeaderValue.GrooveIdentityURL = id.URI; //URI of the local Groove identity or the Groove Data Bridge
AddMember.Url = someOtherString /*Local web string or remote host*/ + space.Members;//A property of the space you are inviting the tuser into
GrooveMembers.Member[] Members = AddMember.Read();//actually connects to the service

GrooveMembers.Member newMember = new GrooveMembers.Member();
newMember.URI = userIdentity;//A string stripped from the database and TRIMmed
newMember.Name = userFullName;//A string also pulled from the database DisplayNeme\GrooveDomain
string userContact = "/GWS/Groove/2.0/Contacts/" + userIdentity.Replace("://", "/");
newMember.Contact = userContact;// A string formatted by replacing :// with / adding "/GWS/Groove/2.0/Contacts/" to the front of the Groove Identity
newMember.Role = "$Telespace.Member";

AddMember.Create(newMember);

GrooveMembers.GrooveMembers AddMember = new GrooveMembers.GrooveMembers();
AddMember.GrooveRequestHeaderValue = new GrooveMembers.GrooveRequestHeader();
AddMember.GrooveRequestHeaderValue.GrooveRequestKey = someString; //Whatever used in your envronment
AddMember.GrooveRequestHeaderValue.GrooveIdentityURL = id.URI; //URI of the local Groove identity or the Groove Data Bridge
AddMember.Url = someOtherString [Local web string or remote host] + space.Members [A property of the space you are inviting the tuser into];
GrooveMembers.Member[] Members = AddMember.Read();//actually connects to the service

GrooveMembers.Member newMember = new GrooveMembers.Member();
newMember.URI = userIdentity;//A string stripped from the database and TRIMmed
newMember.Name = userFullName;//A string also pulled from the database DisplayNeme\GrooveDomain
string userContact = "/GWS/Groove/2.0/Contacts/" + userIdentity.Replace("://", "/");
newMember.Contact = userContact;// A string formatted by replacing :// with / adding "/GWS/Groove/2.0/Contacts/" to the front of the Groove Identity
newMember.Role = "$Telespace.Member";

AddMember.Create(newMember);
于 2009-06-04T06:47:43.613 回答