Share via


4.1 Resolve Principals Knowing Their E-mail Addresses

In this scenario, the protocol client resolves a list of principals (1) knowing their e-mail addresses. The protocol client is interested in all types of principals (1) and it does not attempt to add them to the site collection list of users.

The protocol client issues a ResolvePrincipals request with the known e-mail addresses as principal keys, the principal (1) type set to ALL and the addToUserInfoList parameter set to false. The protocol client sends the following WSDL message:

 <?xml version="1.0" encoding="utf-8"?>
 <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>
     <ResolvePrincipals xmlns="http://schemas.microsoft.com/sharepoint/soap/">
       <principalKeys>
         <string>ben@contoso.com</string>
         <string>doesnotexist@contoso.com</string>
       </principalKeys>
       <principalType>All</principalType>
       <addToUserInfoList>false</addToUserInfoList>
     </ResolvePrincipals>
   </soap:Body>
 </soap:Envelope>

The protocol server then responds with the following:

 <?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>
     <ResolvePrincipalsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
       <ResolvePrincipalsResult>
         <PrincipalInfo>
           <AccountName>MYDOMAIN\account1</AccountName> 
           <UserInfoID>1</UserInfoID> 
           <DisplayName>Ben Smith</DisplayName> 
           <Email>ben@contoso.com</Email> 
           <Department>Marketing</Department> 
           <Title/> 
           <IsResolved>true</IsResolved> 
           <PrincipalType>User</PrincipalType> 
         </PrincipalInfo>
         <PrincipalInfo>
           <AccountName>doesnotexist@contoso.com</AccountName> 
           <UserInfoID>-1</UserInfoID> 
           <IsResolved>false</IsResolved> 
           <MoreMatches /> 
           <PrincipalType>All</PrincipalType> 
         </PrincipalInfo>
       </ResolvePrincipalsResult>
     </ResolvePrincipalsResponse>
   </soap:Body>
 </soap:Envelope>

The protocol client searches the returned array with information about the principals (1) and checks whether they were resolved.