2012-02-07 61 views
0

我正在动态构建CAML字符串,然后通过JavaScript向SharePoint Web服务发送请求以从列表中检索一些(或多个)行。SharePoint dspsts.asmx上的CAML限制vs lists.asmx

当查询lists.asmx我可以建立庞大的CAML查询(1000+ OR巢),它工作正常,但查询dspsts.asmx的时候,我只能累积到25再说了,我得到一个错误:

<?xml version="1.0" encoding="utf-8"?> 
<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:Client.Dsp.Syntax</faultcode> 
     <faultstring>Query syntax error near 'Where'.</faultstring> 
     <detail> 
     <queryResponse xmlns="http://schemas.microsoft.com/sharepoint/dsp"> 
      <dsQueryResponse status="failure" /> 
     </queryResponse> 
     </detail> 
    </soap:Fault> 
    </soap:Body> 
</soap:Envelope> 

回答

1

不知道问题是什么,但是对于与dspsts.asmx有关的任何事情的明显答案是它是obsolete。这个Web服务在10年前就已经在Sharepoint 2.0中引入,并且在SP 2007中使用lists.asmx解决了很多限制。无论问题或问题是什么,它都不会得到解决。

在SharePoint 2010中,最好是尽可能使用REST interface或各种client libraries(对于.NET,Silverlight,Javascript)。这些查询和更新比使用Web服务要容易得多。您甚至可以在.NET客户端中使用LINQ查询,或者在Javascript中使用类似的函数,以使编码更容易。

另外,使用1000个巢还远远不够。我怀疑你正试图执行类似于SQL运算符IN(a,b,c ,,,)的东西。在SharePoint 2010中,您可以使用运算符来完成此操作。

+0

谢谢。 lists.asmx上的1000多个嵌套只是一个测试,以查看它是否是SharePoint整体存在限制/问题,或者问题是否与dspsts.asmx有关。虽然dspsts.asmx会返回更干净的数据,但我只会使用lists.asmx作为此实例。 现在我们仍然使用SP2007,但很快转移到SP2010,所以有趣的是看到新的JavaScript函数和REST接口 – Fergal 2012-02-07 13:35:33