从 C# 中的 Office Communicator (OCS) SDK 获取联系人个人资料信息?

发布于 2024-07-26 09:45:58 字数 360 浏览 2 评论 0原文

我的公司使用 MS Office Communicator Server (OCS) 2007 R2,我使用 SDK 使用 C# 进行访问。

如果我右键单击 OCS 中的联系人,我会看到“查看联系人卡片”选项。 我想通过 API 访问它!

不幸的是,我在 SDK 文档中找不到任何内容来解决这个问题。 有一种名为“ViewProfile”的方法不受支持,我找不到任何有关它的信息。

我当然可以直接访问联系人的 Active Directory 帐户,但这需要我的计算机通过 VPN 连接到组织。 由于我们大多数人都是“离线”工作,所以我宁愿不这样做。 (无论如何,我需要的数据都在 OCS 中!)

提前致谢,安德鲁

My company uses MS Office Communicator Server (OCS) 2007 R2, and I am accessing with C# with the SDK.

If I right click on a contact in OCS, I get the option to 'View Contact Card'. I want access to this via the API!

Unfortunately I can find nothing in the SDK documentation to get at this. There is a method called 'ViewProfile' which is unsupported, and I can find nothing out there about it.

I could of course go directly to the Active Directory account of the contact, but that would require my machine to connect to the organization via VPN. Since most of us work 'offline' I would prefer not to do this. (The data I need is anyway in OCS!)

Thanks in advance, Andrew

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

热血少△年 2024-08-02 09:45:58

如果您订阅目标用户的状态更新,则可以使用“contactCard”状态协议类型捕获此信息...

// Event handler to process remote target's presence notifications
void RemotePresence_PresenceNotificationReceived(object sender, RemotePresenceNotificationEventArgs e)
{
    // Notifications contain all the notifications for one user.
    foreach (RemotePresentityNotificationData notification in e.Notifications)
    {
        // Each user will send a list of updated categories. We will choose the ones we're interested in and process them.
        foreach (PresenceCategoryWithMetaData category in notification.Categories)
        {
            if (category.Name.Equals("contactCard"))
            {
                //get the xml data
                string rawXml = category.CreateInnerDataXml();
                if (rawXml == null || rawXml.Trim().Length == 0)
                {
                    break;
                }

                StringReader reader = new StringReader(rawXml);
                XmlDocument metadataDocument = new XmlDocument();
                metadataDocument.Load(reader);
                // Traverse the xml to get the phone numbers
            }
        }
    }
}

上面的代码更详细一些,以及有关如何订阅远程用户的状态更新的信息可以可以在这里找到...

http://blogs.claritycon.com/blogs/michael_greenlee/archive/2009/03/10/subscribe-to-presence-in-ucma-v2-0.aspx(已死)

http://blog.greenl .ee/2009/03/11/subscribing-to-presence-in-ucma-2-0/(活动)

If you subscribe to the targeted user's presence updates, you can capture this information using the 'contactCard' presence protocol type...

// Event handler to process remote target's presence notifications
void RemotePresence_PresenceNotificationReceived(object sender, RemotePresenceNotificationEventArgs e)
{
    // Notifications contain all the notifications for one user.
    foreach (RemotePresentityNotificationData notification in e.Notifications)
    {
        // Each user will send a list of updated categories. We will choose the ones we're interested in and process them.
        foreach (PresenceCategoryWithMetaData category in notification.Categories)
        {
            if (category.Name.Equals("contactCard"))
            {
                //get the xml data
                string rawXml = category.CreateInnerDataXml();
                if (rawXml == null || rawXml.Trim().Length == 0)
                {
                    break;
                }

                StringReader reader = new StringReader(rawXml);
                XmlDocument metadataDocument = new XmlDocument();
                metadataDocument.Load(reader);
                // Traverse the xml to get the phone numbers
            }
        }
    }
}

The above code in a bit more detail and information on how to subscribe to remote user(s)' presence updates can be found here...

http://blogs.claritycon.com/blogs/michael_greenlee/archive/2009/03/10/subscribe-to-presence-in-ucma-v2-0.aspx (Dead)

http://blog.greenl.ee/2009/03/11/subscribing-to-presence-in-ucma-2-0/ (Alive)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文