Export (0) Print
Expand All

4 Protocol Examples

SharePoint

In this scenario, a protocol client first adds a permission to a list (1) and then gets the collection of permissions for that list (1). The protocol client then updates the recently added permission and gets the collection of permissions again to see the updated collection.

A protocol client first constructs the following SOAP message to add a permission to a list (1). The protocol client sends the SOAP message to the protocol server:

<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>
  <AddPermission xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <objectName>
    Announcements
   </objectName>
   <objectType>
    list
   </objectType>
   <permissionIdentifier>
    HelpGroup
   </permissionIdentifier>
   <permissionType>
    group
   </permissionType>
   <permissionMask>
    -1
   </permissionMask>
  </AddPermission>
 </soap:Body>
</soap:Envelope>

The protocol server then responds with the following:

<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>
  <AddPermissionResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/" />
 </soap:Body>
</soap:Envelope>

To get the collection of permissions from a list (1), the protocol client next constructs the following SOAP message. The protocol client sends the SOAP message to the protocol server:

<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>
  <GetPermissionCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <objectName>
    Announcements
   </objectName>
   <objectType>
    list
   </objectType>
  </GetPermissionCollection>
 </soap:Body>
</soap:Envelope>

The protocol server then responds with the following:

<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>
  <GetPermissionCollectionResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <GetPermissionCollectionResult>
    <GetPermissionCollection>
     <Permissions>
      <Permission MemberID="1" Mask="-1" MemberIsUser="True" MemberGlobal="False" UserLogin="MYDOMAIN\user1" />
      <Permission MemberID="3" Mask="-1" MemberIsUser="False" MemberGlobal="True" GroupName="Farm Administrators" />
      <Permission MemberID="5" Mask="-1" MemberIsUser="False" MemberGlobal="True" GroupName="HelpGroup" />
     </Permissions>
    </GetPermissionCollection>
   </GetPermissionCollectionResult>
  </GetPermissionCollectionResponse>
 </soap:Body>
</soap:Envelope>

To update the permissions for a group to a list (1), the protocol client constructs the following SOAP message and sends it to the protocol server:

<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>
  <UpdatePermission xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <objectName>
    Announcements
   </objectName>
   <objectType>
    list
   </objectType>
   <permissionIdentifier>
    HelpGroup
   </permissionIdentifier>
   <permissionType>
    group
   </permissionType>
   <permissionMask>
    138612833
   </permissionMask>
  </UpdatePermission>
 </soap:Body>
</soap:Envelope>

The protocol server then responds with the following:

<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>
  <UpdatePermissionResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/" />
 </soap:Body>
</soap:Envelope>

To get the collection of permissions from a list (1), the protocol client then constructs the following SOAP message and sends it to the protocol server:

<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>
  <GetPermissionCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <objectName>
    Announcements
   </objectName>
   <objectType>
    list
   </objectType>
  </GetPermissionCollection>
 </soap:Body>
</soap:Envelope>

The protocol server then responds with the following:

<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>
  <GetPermissionCollectionResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <GetPermissionCollectionResult>
    <GetPermissionCollection>
     <Permissions>
      <Permission MemberID="1" Mask="-1" MemberIsUser="True" MemberGlobal="False" UserLogin="MYDOMAIN\user1" />
      <Permission MemberID="3" Mask="-1" MemberIsUser="False" MemberGlobal="True" GroupName="Farm Administrators" />
      <Permission MemberID="5" Mask="138612833" MemberIsUser="False" MemberGlobal="True" GroupName="HelpGroup" />
     </Permissions>
    </GetPermissionCollection>
   </GetPermissionCollectionResult>
  </GetPermissionCollectionResponse>
 </soap:Body>
</soap:Envelope>
Show:
© 2014 Microsoft