1

私の会社では MS Office Communicator Server (OCS) 2007 R2 を使用しており、SDK を使用して C# でアクセスしています。

OCS で連絡先を右クリックすると、[連絡先カードを表示] オプションが表示されます。API経由でこれにアクセスしたい!

残念ながら、これを理解するための SDK ドキュメントには何も見つかりません。サポートされていない「ViewProfile」というメソッドがありますが、それについては何も見つかりません。

もちろん、連絡先の Active Directory アカウントに直接アクセスすることもできますが、その場合、自分のマシンを VPN 経由で組織に接続する必要があります。私たちのほとんどは「オフライン」で作業しているので、これは避けたいと思います。(とにかく、必要なデータは OCS にあります!)

前もってありがとう、アンドリュー

4

1 に答える 1

0

ターゲット ユーザーのプレゼンス更新をサブスクライブすると、「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/ (生きている)

于 2010-04-29T06:44:29.573 に答える