加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

Web服务 – SharePoint List.getListItems WebService以递归方式

发布时间:2020-12-14 18:50:15 所属栏目:资源 来源:网络整理
导读:我从 CXF调用lists.asmx webservice. 以下soap调用不会从列表子文件夹返回文件.它返回folder1,folder2和file1.pdf Shared Documents folder1 file2.docx file3.pdf folder2 sub-folder1 file5.pdf file4.pdf file1.pdf SOAP调用 POST /_vti_bin/lists.asmx H
我从 CXF调用lists.asmx webservice.
以下soap调用不会从列表子文件夹返回文件.它返回folder1,folder2和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>

关于如何从文件夹1,文件夹3和子文件夹1中获取文件的任何线索包含在结果中?
如果列出Web服务无法做到,是否有替代服务/方法?

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

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

解决方法

使用< ViewAttributes Scope =“RecursiveAll”/>可以递归地获得列表内容. elment.
我的肥皂包里有一个愚蠢的错误. queryOptions元素没有命名空间.我在下面的文本中修正了.
<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>

Btw,有一个很棒的工具,U2U CAML Builder构建SharePoint CAML.我希望我在几周前才发现.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读