사용자를 찾기 위해 웹 서비스를 쿼리 할 때 해당 사용자가 사이트의 SharePoint 그룹에 속하지 않으면 ID는 -1입니다.SharePoint People.asmx 웹 서비스에서 -1을 반환합니다.
그러나 사용자는 그룹 권한을 통해 사이트에 접속할 수 있습니다. 따라서 내 웹 서비스 호출은 SharePoint 자체가 추가 할 수있는 경우에도 사용자를 목록 내의 "사람"상자에 추가 할 수 없습니다. 다음과 같이
내 웹 서비스 호출은 다음과 같습니다
String searchText = "[My User's Login Name, Spelled Exactly as it appears in SharePoint.]";
String maxresults = "100";
String pType = "All";
String body = "<?xml version=\"1.0\"?>"
+ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
+ " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ "<soap:Body>"
+ " <SearchPrincipals "
+ " xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">"
+ " <searchText>" + searchText + "</searchText>"
+ " <maxResults>" + maxResults + "</maxResults>"
+ " <principalType>" + pType + "</principalType>"
+ " </SearchPrincipals>"
+ " </soap:Body>"
+ "</soap:Envelope>";
I 웹 서비스 호출에서 다음과 같은 응답을 얻을 :
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SearchPrincipalsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<SearchPrincipalsResult>
<PrincipalInfo>
<AccountName>[User's Account Name]</AccountName>
<UserInfoID>-1</UserInfoID> <------------ NOTE THE -1 HERE -----------------
<DisplayName>[User's full name, exactly as I sent it in]</DisplayName>
<Email>...</Email>
<Department>...</Department>
<Title>...</Title>
<IsResolved>true</IsResolved>
<PrincipalType>User</PrincipalType>
</PrincipalInfo>
</SearchPrincipalsResult>
</SearchPrincipalsResponse>
</soap:Body>
</soap:Envelope>
나는 "사람들에 사용자를 추가하려면이 정보를 사용하는 경우 "상자에서 웹 서비스를 통해 항목이"-1; # 내 사용자 이름 "이되고 찾을 수 없으므로 List.asmx webservice는 0x81020054 : The user does not exist or is not unique.
의 오류를 반환합니다. 사용자를 추가하면 사이트 내의 그룹에 직접 연결하면 ID가 정상적으로 처리되고 모든 것이 정상적으로 처리됩니다. 그룹에서 제거하고 다시 -1로 돌아갑니다.
언제나 올바른 ID를 반환하기위한 의견이나 제안이 있으십니까?
당신은 천재입니다. :) 사실, "ResolvePrincipals"웹 서비스가 존재했는지 전혀 몰랐습니다. 고맙습니다. 그게 내 문제를 해결했다. Pun은 의도하지 않았습니다. – Jerry