UserProfileService.AddLink Method
Adds a link to the My Links page on the My Site for the specified account name.
Namespace: websvcUserProfileService
Assembly: MOSSSOAP (in MOSSSOAP.dll)
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://microsoft.com/webservices/SharePointPortalServer/UserProfileService/AddLink", RequestNamespace := "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService", _
ResponseNamespace := "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function AddLink ( _
accountName As String, _
name As String, _
url As String, _
group As String, _
privacy As Privacy _
) As QuickLinkData
'Usage
Dim instance As UserProfileService
Dim accountName As String
Dim name As String
Dim url As String
Dim group As String
Dim privacy As Privacy
Dim returnValue As QuickLinkData
returnValue = instance.AddLink(accountName, _
name, url, group, privacy)
[SoapDocumentMethodAttribute("https://microsoft.com/webservices/SharePointPortalServer/UserProfileService/AddLink", RequestNamespace = "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
ResponseNamespace = "https://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
Type: System.String
Account name of the user to add a link to.
- name
Type: System.String
A name for the link.
- url
Type: System.String
URL of the link.
- group
Type: System.String
Group to add the link to.
- privacy
Type: websvcUserProfileService.Privacy
Privacy policy of the link.
Return Value
Type: websvcUserProfileService.QuickLinkData
A QuickLinkData object that represents the newly added link.
Remarks
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.
Examples
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);
}
}
}