views:

515

answers:

1

I am trying to use the UserGroup.asmx Sharepoint web service to populate a dropdown list in InfoPath 2007 (2003 compatible form). I followed the instructions here: http://tim.bellette.net/2008/12/13/getting-sharepoint-users-in-infopath-2003. I put the following code in the OnLoad event for the form, and if I set a breakpoint I can see that the GetUserCollectionFromGroupXML DOM contains the correct data, but the dropdown list remains empty. What am I not getting here?

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

Have you tried deduggin in to this code?

it could be a permissions problem. I had somthing similar.

Chris Jones