如何:使用已发布链接 Web 服务

Microsoft Office SharePoint Server 2007 提供已发布链接 Web 服务,使 Microsoft Office 客户端和其他关注的应用程序可以获取服务器上以当前用户为目标的已发布链接的列表。这些链接指向某些 Windows SharePoint Services 3.0 网站,而这些网站可用于从 Office 客户端和其他应用程序中为该用户发布信息。利用管理接口和对象模型,可以将已发布的链接添加到服务器中。

此 Web 服务位于 http://<网站 URL>/_vti_bin/publishedlinks.asmx。

示例

下面的代码示例显示指向某些 Windows SharePoint Services 网站的链接,这些网站可供当前用户用于从 Office 客户端和其他应用程序发布信息。

using System;
using System.Collections.Generic;
using System.Text;

namespace PublishedLinksWebServiceApp
{
    class Program
    {
        static void Main(string[] args)
        {
            localhost.PublishedLinksService myService =
            new PublishedLinksWebService.localhost.PublishedLinksService();
            myService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            localhost.ServerLink[] links = myService.GetLinks();
            for (int i = 0; i < links.Length; i++)
            {
                Console.WriteLine(links[i].Url);
            }
        }
    }
}

See Also

任务

如何:使用 Web 服务找出两个用户配置文件之间的相同内容

如何:使用 Web 服务修改用户配置文件数据

如何:使用 Web 服务检索用户的配置文件数据

如何:使用 Web 服务添加链接和同事