0 out of 7 rated this helpful - Rate this topic

UserProfileService.AddLink Method (websvcUserProfileService)

Adds a link to the My Links page on the My Site for the specified account name.

Namespace: websvcUserProfileService
Assembly: MOSSSOAP (in mosssoap.dll)

[SoapDocumentMethodAttribute("http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/AddLink", RequestNamespace="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService", ResponseNamespace="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public QuickLinkData AddLink (
	string accountName,
	string name,
	string url,
	string group,
	Privacy privacy
)

Parameters

accountName

Account name of the user to add a link to.

name

A name for the link.

url

URL of the link.

group

Group to add the link to.

privacy

Privacy policy of the link.

Return Value

A QuickLinkData object that represents the newly added link.

The following example shows how to add a link to the My Links page on a My Site.

Make sure you add a Web reference to a UserProfileService Web service site you have access to. Change the using AddLinkSample.MyServer002; directive to point to the Web service site you are referencing. In addition, replace "domain\\username" with valid values.

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

// TODO 
// Change the using AddLinkSample.MyServer002 directive
// to point to the Web service you are referencing.
using AddLinkSample.MyServer002;

namespace AddLinkSample
{
    class Program
    {
        static void Main(string[] args)
        {
            //Instantiate the Web service. 
            UserProfileService userProfileService = new UserProfileService();

            //Set credentials for requests.
            //Use the current user log-on credentials.
            userProfileService.Credentials =
                System.Net.CredentialCache.DefaultCredentials;

            // TODO 
            // Replace "domain\\username" with valid values.
            userProfileService.AddLink("domain\\username", "Developer Resources", "http://example", "Development", Privacy.Organization);

        }
    }
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.