【问题标题】:Populating an InfoPath control with SharePoint users使用 SharePoint 用户填充 InfoPath 控件
【发布时间】:2010-06-07 20:00:05
【问题描述】:

我正在尝试使用 UserGroup.asmx Sharepoint Web 服务来填充 InfoPath 2007(2003 兼容表单)中的下拉列表。我按照这里的说明进行操作:http://tim.bellette.net/2008/12/13/getting-sharepoint-users-in-infopath-2003。我将以下代码放在表单的 OnLoad 事件中,如果设置断点,我可以看到 GetUserCollectionFromGroupXML DOM 包含正确的数据,但下拉列表仍然为空。我在这里没有得到什么?

        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>");

【问题讨论】:

  • 您是否设置了下拉列表以查看正确的数据连接?

标签: c# xml web-services sharepoint infopath


【解决方案1】:

您是否尝试过对这段代码进行 deduggin?

可能是权限问题。我有类似的东西。

【讨论】:

    猜你喜欢
    • 2022-10-05
    • 1970-01-01
    • 2021-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多