How to GetListItems Lists.asmx - InfoPath Dev
in

InfoPath Dev

How to GetListItems Lists.asmx

Last post 05-31-2011 08:29 AM by aninfoworker. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-30-2011 09:23 AM

    How to GetListItems Lists.asmx

    How to use the method GetListItems of the webservice http://sharepoint/_vti_bin/Lists.asmx in InfoPath 2010?

    What are the right values und format for the parameters of method GetListItems? I've tried a lot, but none worked.


    tns:listName
    My List Name, Guid, xml encode listname,...


    tns:viewName
    View Name, Guid,

     tns:query
    <Query> [empty or ] </Query>
    0x82000000tns:viewFields'>

    0x82000000tns:viewFields'>

    tns:viewFields

    <ViewFields><FieldRef Name="ID" /><FieldRef Name="Title" /></ViewFields>


    tns:rowLimit
    10

    tns:queryOptions
    ??


    tnsWebID
    the Guid of the current site?

  • 05-30-2011 01:41 PM In reply to

    Re: How to GetListItems Lists.asmx

    Are you using SharePoint 2010? If so, you may want to look at using the OData interface - it's much more powerful because it allows for filtering of the data and the interface is easy. I'll ask Hilary to respond with more details.

    Patrick Halstead
    Project Manager at Qdabra
  • 05-31-2011 02:17 AM In reply to

    Re: How to GetListItems Lists.asmx

    Yes, I'm using SharePoint 2010. I'm not experienced in OData services, but I've used Lists.asmx in Visual Studio but not without code in InfoPath. I hoped that I can omit the code-behind class and just use the InfoPath GUI, but it seems to be even more difficult than accessing Lists.asmx in a code-behind file! 

    When I try to use http://sharepoint/_vti_bin/listdata.svc (in the browser)

     The type "System.Data.Services.Providers.IDataServiceUpdateProvider" in assembly  "System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" could not be loaded.

    (I've translated the message to english, so there's a chance that it might sound a little bit different in original English)

    In InfoPath it doesn't work, too. 

     Update:

    There's a need to install an update. I followed the instructions in this post

     http://blog.fpweb.net/sharepoint-2010-fix-for-common-odata-error/ 

     and the listdata.svc call in the browser shows me XML data :-)

     Showstopper

     I've to access an external list (BCS) not a native SharePoint list. Unfortunately as Clayton Cobb (MVP) said here http://social.technet.microsoft.com/Forums/en-CA/sharepoint2010customization/thread/cea27774-ae15-42b9-bf8f-015281cfe5e0 there's no support for external lists with ListData.svc :-(

    That's why I have to come back to my initial question:

    How to use the method GetListItems of the webservice http://sharepoint/_vti_bin/Lists.asmx in InfoPath 2010? What are the right values und format for the parameters of method GetListItems?

  • 05-31-2011 08:14 AM In reply to

    Re: How to GetListItems Lists.asmx

    Sorry to be the bearer of bad tidings, but to my knowledge there is no way to use GetListItems in InfoPath with a data connection. You can write code to call the web service. Or you can try this approach, which combines code and an IP data connection, but involves manual modifications of the template files as well. I've never walked through that blog post, so I have no idea how well it works.

    Oh, and when you want to know more about parameters for a SharePoint web service, MSDN is the place to go. Here's the scoop on GetListItems. As you can see, the method expects several XmlNodes -- from your IP data connection, you are only able to pass in strings.

    And, to answer your original question a bit more, from MSDN:

    webID

    Optional. A string containing the GUID of the parent Web site for the list surrounded by curly braces ({}). Setting this parameter to null means the Web site specified by the Url property of the service will be used, and if the Url property of the service is not specified, the root Web site will be used.

    Hilary Stoupa

  • 05-31-2011 08:29 AM In reply to

    Re: How to GetListItems Lists.asmx

    Sometimes bad news are better than none, so I appreciate your detailed and very helpful answer!

    I was hoping that there might be an automated string to XmlNode conversion in InfoPath and that I've only have to format the strings right. But you dashed my hope and I'll seek for a code behind solution (the InfoPath form is part of a compley workflow, I tried to avoid more complexity by adding code behind).

    Another approach for my problem could be retrieve all data and filter the external list's data on the client. I've to test if this is not a performance killer...

    Perhaps I'm developing my custom "string parameter webservice" to consume in InfoPath...

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.