Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Using: InfoPath 2003, SharePoint 2007 WSS

I've tried Googling the problem and got nothing helpful, and this is my first time trying to use a web service to connect InfoPath and SharePoint, so bear with me.

I'm trying to use one of the OOB web services to access the list of users in SharePoint from an InfoPath form. I started by following an approximation of the steps found here: http://sharepointmagazine.net/articles/a-humble-tribute-to-the-leave-form-part-5

The difference is that instead of getting the name of the current SharePoint user, I want to get the total list of users. So, I thought the UserGroup web service with the GetUserCollection function would be the way to go.

However, on the screen in the Data Connection wizard that says "Set Sample Value," I can't seem to figure out what counts as valid data for tns:userLoginNamesXml, which is the only parameter.

Please help me figure out what to enter - or if there's another approach I should be taking. I tried entering a username but I don't think that even makes any sense. The data type field for the parameter is blank and read-only. I'm assuming it's some kind of SharePoint-specific data type? Maybe?

Main error: "InfoPath was unable to create a schema from the results of the Web service call."

Details: "The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. Data at the root level is invalid. Line 1, position 1."

share|improve this question

2 Answers 2

Have a look at my blog post on using Sharepoint UserGroup web service with InfoPath to see if it helps:

http://blog.ianchivers.com/2011/01/using-sharepoint-usergroup-web-service.html

share|improve this answer

Check out the ULS logs. It looks like the string that is set into the Sample Data field is being encoded. This may be why the web service thinks its poorly formed XML.

You can see a snippet of the XML that the web service expects here.

Depending on what you're looking to do, the User Information List may also give you what you need. In InfoPath:

  1. Click on the Data Tab
  2. Choose From SharePoint List
  3. Enter the site's URL > Next
  4. Select User Information List > Next
  5. Pick the fields you'd like to use > Next
  6. Set whether to store data in the form > Next
  7. Set whether to return data on form opening > Done

Clayton Cobb describes how the User Information List gets filled in this post.

share|improve this answer
    
I wish they would provide examples of what sort of sample values are expected. Does it want a list of users? I'm trying to judge by the XML but it's hard to say. Also, where is this "Data Tab"? I don't see anything like that. –  Rae Oct 20 '11 at 11:52
    
Appologies, that was from SharePoint 2010. In InfoPath 2003, you need to create a data connection to receive information. You should be able to use this example to connect to the User Information List: office.microsoft.com/en-us/infopath-help/… –  Panter Oct 20 '11 at 15:08
    
More on the User Information List: zimmergren.net/archive/2008/06/25/… –  Panter Oct 20 '11 at 15:09
    
The first link just shows how to use a data connection, so I assume I'm supposed to merge it with your main answer to make this work? Trying this, User Information List is not an option that comes up as a list or otherwise, at all. The second link says that the only way to access the UIL is as an admin, which isn't going to work. Other users need to be able to pull up this form and see the list in a dropdown menu in an InfoPath form. –  Rae Oct 21 '11 at 14:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.