Exception in SharePoint 2010 when updating UserProfile using a web service

I'm updating the UserProfile using the code below



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

namespace UserProfileWebServiceApp
{
    class Program
    {
        public static localhost.UserProfileService myService =
            new localhost.UserProfileService();
        UserProfileWebService.localhost.PropertyData[] newdata = 
    new UserProfileWebService.localhost.PropertyData[1];
            newdata[0] = 
                new UserProfileWebService.localhost.PropertyData();
            newdata[0].Name = "HomePhone";
            newdata[0].Values = new ValueData[1];
            newdata[0].Values[0] = new ValueData();
            newdata[0].Values[0].Value = "aa";
            newdata[0].IsValueChanged = true;
            myService.ModifyUserPropertyByAccountName("domainname\\username", 
                newdata);

    }
}

an soap exception occur --> Attempted to perform an unauthorized operation.
anyone help me
thanks
1
задан skeletank 5 May 2012 в 01:47
поделиться