1

This List.getListItems(String, String, Query, ViewFields, String, QueryOptions, String) webservice ( when called from Java) returns sub folders as single nodes. Is there a way to recursively get all sub folder contents?

I have tried <ViewAttributes Scope='RecursiveAll' /> under QueryOptions with no luck. First I tried with the following

POST /_vti_bin/lists.asmx HTTP/1.1 Accept-Encoding: gzip,deflate

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap1="http://schemas.microsoft.com/sharepoint/soap/">
   <soap:Header/>
   <soap:Body>
      <soap1:GetListItems>
         <soap1:listName>Shared Documents</soap1:listName>
       <queryOptions> 
        <QueryOptions> 
       <IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>
           <ViewAttributes Scope="RecursiveAll"/>
           <DateInUtc>TRUE</DateInUtc>               
        </QueryOptions>
      </queryOptions> 
      </soap1:GetListItems>
   </soap:Body>
</soap:Envelope>

This is running against SharePoint 2010.

Second trial#. Returns only the one level of folders.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap1="http://schemas.microsoft.com/sharepoint/soap/">
   <soap:Header/>
   <soap:Body>
      <soap1:GetListItems>
         <soap1:listName>Shared Documents</soap1:listName>
      <soap1:query>
        <Query>
             <Where>
                   <Eq>
                   <FieldRef Name='FSObjType' />
                   <Value Type='Lookup'>1</Value>
                   </Eq>
                   </Where>
      </Query>
         </soap1:query>
       <queryOptions> 
       <ViewAttributes Scope="RecursiveAll"/>
        <QueryOptions> 
       <IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>
           <ViewAttributes Scope="RecursiveAll"/>
           <DateInUtc>TRUE</DateInUtc>               
        </QueryOptions>
      </queryOptions> 
      </soap1:GetListItems>
   </soap:Body>
</soap:Envelope>

2 Answers 2

2

I suspect it is just a problem with the syntax you are assigning to the properties on the proxy. Check out this forum post for an example:

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/23952974-1c66-48e9-b897-9a4e7ac044b6

4
  • I pasted the actual soap message above. what is proxy?, did you mean QueryOptions?.
    – so_mv
    Jun 14, 2011 at 21:52
  • The objects you are using to invoke the web service are referred to as a proxy. Jun 14, 2011 at 22:17
  • Thanks. Any idea why both the soap envlopes did not work?
    – so_mv
    Jun 15, 2011 at 0:43
  • I found the issue. It is the missing namespace for queryOptions
    – so_mv
    Jun 15, 2011 at 20:47
1

So finally I figured it you!

The Problem was like Kit Menke told me that there was a namespace issue!

Instead of:

<listName><ListName>Style Library</ListName></listName>

I had to write:

<ListName>Style Library</ListName>

I still don't know why this was the issue but finally its solved.

It took the ListName right but everything after Listname wasnt taken at all.

Hope that this will help somebody with the same issue

2
  • if this was the solution that worked, you should mark it as answer Aug 7, 2012 at 9:42
  • I've been looking everywhere for this. Could you kindly post the java code for how you built and passed the QueryOptions argument into the List.getListItems() method. I hope its not too late to post in this thread.
    – user19770
    Sep 26, 2013 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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