SharePoint List.getListItems WebService递归返回子文件夹内容 [英] SharePoint List.getListItems WebService to return sub folder contents, recursively

查看:192
本文介绍了SharePoint List.getListItems WebService递归返回子文件夹内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 CXF 调用list.asmx Web服务. 以下肥皂调用不会从列表子文件夹中返回文件.它返回folder1,folder2和file1.pdf

I am calling the lists.asmx webservice from CXF. The following soap call does not return files from list sub folders. It returns folder1,folder2 and file1.pdf

Shared Documents
  folder1
     file2.docx
     file3.pdf
  folder2
     sub-folder1
        file5.pdf
     file4.pdf
  file1.pdf

SOAP调用

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>

关于如何从结果中包含的folder1,folder3和sub-folder1获取文件的任何线索吗? 如果Lists Web服务无法做到,是否有替代服务/方法?

Any clues on how to get files from folder1, folder3 and sub-folder1 included in the result?. If Lists web service cannot do it, is there an alternative service/method?

其他信息: 还有另一个Web服务SiteData (_vti_bin/sitedata.asmx).它有一个类似的方法(getListItems)并返回仅包含列表名称且没有其他参数的所有文件.问题是我无法弄清楚如何/在何处指定Paging参数,因为像Lists一样没有queryOptions输入元素网络服务.

Additional Information: There is another webservice, SiteData (_vti_bin/sitedata.asmx). It has a similar method ( getListItems) and returns all files with just the list name and no additional parameters.The issue is I could not figure out how/where to specify the Paging parameter, as there is NO queryOptions input element like in the Lists webservice.

 <soap1:strListName>?</soap1:strListName>
 <soap1:strQuery>?</soap1:strQuery>
 <soap1:strViewFields>?</soap1:strViewFields>
 <soap1:uRowLimit>?</soap1:uRowLimit>

推荐答案

使用<ViewAttributes Scope="RecursiveAll"/>元素可以递归获取列表内容. 我的肥皂信封有一个silly错误. queryOptions元素没有名称空间.我修复了以下文本.

It is possible to get the list contents recursively, using <ViewAttributes Scope="RecursiveAll"/> elment. There is a silly mistake in my soap envelope. The queryOptions element has no namespace. I fixed in the following text.

<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:**queryOptions> 
        <QueryOptions> 
           <IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>
           <ViewAttributes Scope="RecursiveAll"/>
           <DateInUtc>TRUE</DateInUtc>               
        </QueryOptions>
      </**soap1:**queryOptions> 
      </soap1:GetListItems>
   </soap:Body>
</soap:Envelope>

顺便说一句,有一个很棒的工具, U2U CAML Builder 可以构建SharePoint CAML.我希望我能在几周前找到它.

Btw, there is a great tool, U2U CAML Builder to build SharePoint CAML. I wish I found that a few weeks ago.

这篇关于SharePoint List.getListItems WebService递归返回子文件夹内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆