深入浅出InfoPath2007—使用UserGroup Web Service来得到当前用户所在的群组信息

应用场景:
获得当前流程审批环节中,判断当前用户是否属于可以进行审批的群组人员。

解决方案:

1 创建空的InfoPath模板,然后创建数据源用来接收收据。

2 使用UserGroup webservice

注意:记得勾选“当表单打开的时候自动接收数据”,保证数据的及时更新。

 

 

3 修改xsd文件中对数据源GetGroupCollectionFromUser的定义。

 

打开Developers1.xsd(可能为其他文件名)

1
2  <?xml version="1.0"?>
3  <s:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">
4 <s:import namespace="http://www.w3.org/2001/XMLSchema"></s:import>
5 <!-- Beginning of insert -->
6 <s:complexType name="GetUserCollectionFromGroupType">
7 <s:sequence>
8 <s:element minOccurs="0" maxOccurs="1" name="Users">
9 <s:complexType>
10 <s:sequence>
11 <s:element maxOccurs="unbounded" name="User" >
12 <s:complexType>
13 <s:attribute name="Notes" type="s:string"></s:attribute>
14 <s:attribute name="Name" type="s:string"></s:attribute>
15 <s:attribute name="IsSiteAdmin" type="s:string"></s:attribute>
16 <s:attribute name="Sid" type="s:string"></s:attribute>
17 <s:attribute name="ID" type="s:string"></s:attribute>
18 <s:attribute name="LoginName" type="s:string"></s:attribute>
19 <s:attribute name="Email" type="s:string"></s:attribute>
20 <s:attribute name="IsDomainGroup" type="s:string"></s:attribute>
21 </s:complexType>
22 </s:element>
23 </s:sequence>
24 </s:complexType>
25 </s:element>
26 </s:sequence>
27 </s:complexType>
28 <!-- End of Insert -->
29 <s:element name="GetUserCollectionFromSite">
30 <s:complexType></s:complexType>
31 </s:element>
1
2  <!--<s:element name="GetUserCollectionFromGroup">
3 <s:complexType>
4 <s:sequence>
5 <s:element minOccurs="0" maxOccurs="1" name="groupName" type="s:string"></s:element>
6 </s:sequence>
7 </s:complexType>
8 </s:element>-->
9  <!-- Beginning of insert -->
10  <s:element name="GetUserCollectionFromGroup" type="tns:GetUserCollectionFromGroupType" />
11  <!-- End of insert -->

保存修改后的xsd文件后,我们在InfoPath的看到数据源GetGroupCollectionFromUser中存储的数据发生了变化。

 

Template download

原文地址:https://www.cnblogs.com/mingle/p/InfoPath_UserGroupWebService.html