Groove Web Services问题GrooveMembers.Create

时间:2009-05-12 11:09:04

标签: c# service groove

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

尽管如此,我还是遇到了自动邀请的绊脚石。我正在运行它作为一个独立的网站“桥”,所以我试图从网络服务器纯粹运行它。我有一个Groove标识,我想从数据库中邀请的人是一个字符串:

CurrUserIdentity = grooveIdentity:// nzkth68eqzgktrb9sbr ....

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

2 个答案:

答案 0 :(得分: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);

答案 1 :(得分:1)

Groove Web Services V12帮助程序库可以提供更易于管理的API来执行该任务 - http://gwsv12helpers.codeplex.com/