Sharepoint使用分页查询列表

时间:2017-02-13 17:59:23

标签: sharepoint soap sharepoint-2010

我正在使用SOAP UI查询Sharepoint List。这是我更新的** SOAP请求:

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:GetListItems>
         <!--Optional:-->
         <soap:listName>Example</soap:listName>
         <!--Optional:-->
         <soap:viewName>{AAAAA-AAAA-AAA-AAAAA}</soap:viewName>
         <!--Optional:-->
         <soap:query>
            <Query>
            </Query>
         </soap:query>
         <!--Optional:-->
         <soap:viewFields>
            <ViewFields>
                <FieldRef Name="Author" />
                    <FieldRef Name="ContentType" />
                    <FieldRef Name="ContentTypeId" />
            </ViewFields>
         </soap:viewFields>
         <!--Optional:-->
         <soap:rowLimit>1000</soap:rowLimit>
         <!--Optional:-->
         <soap:queryOptions>
            <QueryOptions>
                   <ViewAttributes Scope="RecursiveAll"/>
            </QueryOptions>
         </soap:queryOptions>
         <!--Optional:-->
         <soap:webID></soap:webID>
      </soap:GetListItems>
   </soapenv:Body>
</soapenv:Envelope>

运行时出现以下错误:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring>
         <detail>
            <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator.Operations that exceed the list view threshold are allowed in the following time window defined by the administrator: &lt;br/>&lt;b>Daily, from  7:00:00 PM to 11:00:00 PM . &lt;/b></errorstring>
            <errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x80070093</errorcode>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

我可以在错误中提到的小时内访问列表,但是在这些时间之外,是否有任何方式通过分页或其他允许访问此列表的内容?感谢您的任何帮助。

1 个答案:

答案 0 :(得分:1)

该错误不是抱怨结果的数量,而是关于视图中显示的查询列的数量。

当您在CAML查询中包含查找列时,SharePoint必须在后台执行一些额外的工作以查询相关列表并提取相关信息。这可能会影响数据库性能,因此SharePoint会在工作时间为每个查询设置8个查询列的默认限制。 (在SharePoint 2013中,它会扩展为12.)有关详细信息,请参阅this Microsoft blog post

请注意,就阈值而言,&#34;查找列&#34;包括查找人员或群组类型的列,以及工作流状态列。

要在工作时间执行查询,您可以从视图中删除列,直到视图不再显示超过8个查找列。