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

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>
share|improve this question
add comment

2 Answers 2

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

share|improve this answer
    
if this was the solution that worked, you should mark it as answer –  Anders Rask Aug 7 '12 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 '13 at 0:33
add comment

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

share|improve this answer
    
I pasted the actual soap message above. what is proxy?, did you mean QueryOptions?. –  so_mv Jun 14 '11 at 21:52
    
The objects you are using to invoke the web service are referred to as a proxy. –  Chris Beckett Jun 14 '11 at 22:17
    
Thanks. Any idea why both the soap envlopes did not work? –  so_mv Jun 15 '11 at 0:43
    
I found the issue. It is the missing namespace for queryOptions –  so_mv Jun 15 '11 at 20:47
add comment

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.