0
我正尝试使用UserGroup.asmx Sharepoint Web服务来填充InfoPath 2007(2003兼容表单)中的下拉列表。我遵循这里的说明:http://tim.bellette.net/2008/12/13/getting-sharepoint-users-in-infopath-2003。我在窗体的OnLoad事件中放置了下面的代码,如果我设置了一个断点,我可以看到GetUserCollectionFromGroupXML DOM包含正确的数据,但下拉列表仍然为空。我不在这里?使用SharePoint用户填充InfoPath控件
XmlDocument userCollectionFromGroup = new XmlDocument();
userCollectionFromGroup.LoadXml(thisXDocument.DataObjects["GetUserCollectionFromGroup"].DOM.xml);
XPathNavigator siteUsers = userCollectionFromGroup.CreateNavigator();
XmlNamespaceManager manager = new XmlNamespaceManager(siteUsers.NameTable);
manager.AddNamespace("dfs", "http://schemas.microsoft.com/office/infopath/2003/dataFormSolution");
manager.AddNamespace("tns", "http://schemas.microsoft.com/sharepoint/soap/directory/");
// Query the user nodes
XPathNavigator allUsers = siteUsers.SelectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetUserCollectionFromGroupResponse/tns:GetUserCollectionFromGroupResult/tns:GetUserCollectionFromGroup/tns:Users", manager);
// Load the users into the SiteUsersAndGroups connection
thisXDocument.DataObjects["GetUserCollectionFromGroupXML"].DOM.loadXML("<GetUserCollectionFromGroup>" + allUsers.OuterXml + "</GetUserCollectionFromGroup>");
您是否设置了下拉列表来查看正确的数据连接? – 2009-10-07 11:34:49