4.2 Retrieve and Update User Information
The following example demonstrates the protocol client requests and protocol server responses that are used in this protocol to get information about the users in the current site (2) and update the information about one user. The example consists of two operations:
-
Get all user information from the current site (2).
-
Update the information about a user.
-
The protocol client sends a GetUserCollectionFromWeb request (section 3.1.4.28.1.1) to get information about the users in the current site (2).
<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> <GetUserCollectionFromWeb xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/" /> </soap:Body> </soap:Envelope> -
The protocol server sends a GetUserCollectionFromWeb response (section 3.1.4.28.1.2) with the information about the users in the current site (2) as follows.
<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> <GetUserCollectionFromWebResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/"> <GetUserCollectionFromWebResult> <GetUserCollectionFromWeb> <Users> <User ID="1" Sid="S-1-5-21-2127521184-1604012920-1887927527- 3500199" Name="Rachel Valdez" LoginName="contoso\rachel" Email="rachel@contoso.com" Notes="" IsSiteAdmin="True" IsDomainGroup="False" /> <User ID="17" Sid="S-1-5-21-2127521184-1604012920-1887927527- 2895802" Name="Neil Black" LoginName="contoso\neil" Email="neil@contoso.com" Notes="some notes" IsSiteAdmin="False" IsDomainGroup="False" /> </Users> </GetUserCollectionFromWeb> </GetUserCollectionFromWebResult> </GetUserCollectionFromWebResponse> </soap:Body> </soap:Envelope> -
The protocol client sends an UpdateUserInfo request (section 3.1.4.44.1.1) to update the information of a specified user.
<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> <UpdateUserInfo xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/"> <userLoginName>contoso\todd</userLoginName> <userName>Todd Rowe</userName> <userEmail>todd@contoso.com</userEmail> <userNotes>updated user info</userNotes> </UpdateUserInfo> </soap:Body> </soap:Envelope> -
The protocol server updates the information of the specified user and sends an UpdateUserInfo response (section 3.1.4.44.1.2) as follows.
<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> <UpdateUserInfoResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/" /> </soap:Body> </soap:Envelope>