【问题标题】:GetListItems not returning items in SharePoint 2013GetListItems 不返回 SharePoint 2013 中的项目
【发布时间】:2014-07-04 18:58:50
【问题描述】:

我们正在查询 SharePoint 2013 Web 服务方法 - GetListItems 以获取列表中的项目列表,但它返回 0 个项目。奇怪的是同一段代码在 SharePoint 2010 中工作,因为它用于在指定的共享点列表中返回文件列表,但是自从升级到 SharePoint 2013 后,它返回 0 个项目,甚至没有抛出任何异常.

以下是传递给 GetListItems 方法的参数。

<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>Accounts</listName>
<query>
<Query xmlns="">
<Where><Contains><FieldRef Name="FileDirRef" /><Value Type="Text">foldertoread</Value></Contains></Where>
</Query></query>
<viewFields><ViewFields xmlns="" /></viewFields>
<rowLimit>50</rowLimit>
<queryOptions>
<QueryOptions xmlns=""><Folder>foldertoread</Folder></QueryOptions>
</queryOptions>
</GetListItems>

【问题讨论】:

    标签: sharepoint sharepoint-2010 sharepoint-2013 caml


    【解决方案1】:

    SharePoint2013 对标签的感知方式似乎发生了微妙的变化。我们不必提及文件夹名称,而是必须提及完整的文件夹路径才能使其正常工作。

    有效的修改参数列表:

    <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <listName>Accounts</listName>
    <query>
    <Query xmlns="">
    <Where><Contains><FieldRef Name="FileDirRef" /><Value Type="Text">foldertoread</Value></Contains></Where>
    </Query></query>
    <viewFields><ViewFields xmlns="" /></viewFields>
    <rowLimit>50</rowLimit>
    <queryOptions>
    <QueryOptions xmlns=""><Folder>Accounts/foldertoread</Folder></QueryOptions>
    </queryOptions>
    </GetListItems>
    

    【讨论】:

      猜你喜欢
      • 2014-11-21
      • 1970-01-01
      • 2018-03-09
      • 1970-01-01
      • 1970-01-01
      • 2016-01-03
      • 1970-01-01
      • 2016-07-25
      • 1970-01-01
      相关资源
      最近更新 更多