Web Services in SharePoint 2007

This tutorial shows how to access the user names from People or Groups using

SharePoint webservices

Step 1: On DataSource Library pane, XML Web Services is the option to invoke
web services.

Step 2: Paste the web services link (https://<sharepointLocation>/_vti_bin/usergroup.asmx?WSDL)
for the user group data and click on connect. This will retrieve data of people.

In this below screenshot, GetUserCollectionFromGroup is an operation which retrieves the
people details belongs to the specified group name.

Step 3: Once the operation selected, it will show the parameters required for
that operation. In this case, groupName is the input parameter for
GetUserCollectionFromGroup. I have created a NewGroup group in my sharePoint. So
here i am passing “NewGroup” to that operation.

Step 4: Click on Login tab. Enter Username and password to establish the
connection

Step 5: Now click on show data, it will show all the data.

Step 6: Select Name and click on Insert Selected Fields and select multiple item
view

Step 7: This will show the data into the screen . The next step is to filter
the data based on the current login.

in the above screenshot, UserID needs included in order to use the CAMLVariable
UserID.

Step 8: Please change the below code to see if the current user name exists in
the group

In order to get the Number
of Rows
<xsl:variable name=”Rows” select=”/soap:Envelope/soap:Body/ddw1:GetUserCollectionFromGroupResponse/ddw1:GetUserCollectionFromGroupResult/ddw1:GetUserCollectionFromGroup/ddw1:Users/ddw1:User”/>

to<xsl:variable name=”Rows” select=”/soap:Envelope/soap:Body/ddw1:GetUserCollectionFromGroupResponse/ddw1:GetUserCollectionFromGroupResult/ddw1:GetUserCollectionFromGroup/ddw1:Users/ddw1:User[@Name=$UserID]“/>
<table>
<tr><td>
<xsl:value-of select=”$count(Rows)” />
</td></tr>

</table>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.