The code which return to access people service in sharpoint 2010 is working fine using defualt url but givingThe request failed with HTTP status 401: Unauthorized. while accessing through Alternate access URL.I have passed valid network credentials also still givein error//find below the code
SPCustomUser.People ppl
= new SPCustomUser.People();
ppl.Url = webURL + "/_vti_bin/people.asmx";
string CustomUserID
= System.Configuration.ConfigurationSettings.AppSettings["CustomUserID"].ToString();
string CustomUserPassword
= System.Configuration.ConfigurationSettings.AppSettings["CustomUserPassword"].ToString(); string CustomUserDomain
= System.Configuration.ConfigurationSettings.AppSettings["CustomUserDomain"].ToString();
ppl.Credentials = new System.Net.NetworkCredential(
CustomUserID, CustomUserPassword, CustomUserDomain);
SPCustomUser.PrincipalInfo[] principalInfoUser = ppl.ResolvePrincipals(userLogin, SPCustomUser.SPPrincipalType.User, false); if (principalInfoUser[0].UserInfoID
== (-1))
{
//Add
and Get user info if user is not added in the site
principalInfoUser = ppl.ResolvePrincipals(userLogin, SPCustomUser.SPPrincipalType.User, true);
}
//get SharePoint user
id(unique) and user account name
userInfo = principalInfoUser[0].DisplayName;
return userInfo;
//error at SPCustomUser.People.ResolvePrincipals(String[] principalKeys, SPPrincipalType principalType, Boolean addToUserInfoList)