This project has moved and is read-only. For the latest updates, please go here.

Why no 'ResolvePrincipals' option? Is it because of permissions?

Apr 25, 2012 at 3:59 PM

In trying to create a jquery based autocomplete solution which gives the user a list of user Principals to select from, I found that in order to get the UserInfoID for a user on the given site, that user must be added to some SPUserCollection on that site (  One way to do this is to call the ResolvePrincipals web method and set the 'addToUserInfoList' flag to true.  Doing this server-side, by referencing the People service and calling ResolvePrincipals method, works just as it should.

I notice that there is no ResolvePrincipals operation for SPServices, so I decided to add my own.  However, calling this method gives a permissions error when I set 'addToUserInfoList' flag to true; setting it to false doesn't give an error but of course doesn't actually add the user. 

So, my question is, is this by design?  Is there something special about 'ResolvePrincipals' that makes it unsuitable to implement using jQuery?  Does it have something to do with permissions? 

Here are my artifacts:

code to implement 'ResolvePrincipals' web method (operation):


WSops.ResolvePrincipals = [PEOPLE, false];


case "ResolvePrincipals":
     addToPayload(opt, ["principalKeys", "principalType", "addToUserInfoList"]);

code to execute 'ResolvePrincipals' client-side:


	operation: "ResolvePrincipals",
	principalKeys: "<string>" + ui.item.__ParameterForLookup + "</string>",
	addToUserInfoList: true,
	principalType: "User",
	async: false,
	completefunc: function(xData, Status){
		DebugWrite("ResolvePrincipals", xData);



xml payload sent to People web service:


<soap:Envelope xmlns:xsi='' xmlns:xsd='' xmlns:soap=''>
		<ResolvePrincipals xmlns=''>


response as read from xData (http status 500):


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
			<faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring>
				<errorstring xmlns="">The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.</errorstring>
				<errorcode xmlns="">0x8102006d</errorcode>



Apr 25, 2012 at 6:31 PM


The only reason it's not there is that I never added it. It also wasn't available in 2007.

I'm guessing that you are indeed seeing a permissions issue. Since I've never tried the operation, I don't know exactly what it needs.

Thanks for the code bits above. I'll add the operation into the next release.


Apr 25, 2012 at 6:32 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 25, 2012 at 6:38 PM

p.s. The errors we get from the Web Services are often quite misleading. It may well mean something entirely different than what it says.


May 31, 2012 at 12:20 PM

FYI - I've added the ResolvePrincipals operation into the latest alpha. Check the work item link above for details. Let me know if you get a chance to try it out!