I’m dynamically building a CAML string then sending a request to SharePoint web services via JavaScript to retrieve some (or lots of) rows from a list.
When querying lists.asmx I can build huge CAML queries (1000+ OR nests) and it works fine but when querying dspsts.asmx I can only build up to 25. Anything more and I get an error:
<?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>
Not sure what the question is, but an obvious answer to anything having to do with dspsts.asmx is that it is obsolete. This web service was introduced in Sharepoint 2.0 almost 10 years ago and has a lot of limitations that were resolved in SP 2007 with lists.asmx. No matter what the question or the problem is, it won’t get fixed.
In SharePoint 2010 it is preferable to use the REST interface or the various client libraries (for .NET, Silverlight, Javascript) wherever possible. These queries and updates a lot easier than using the web services. You can even use LINQ queries in .NET clients or similar functions in Javascript to make coding a lot easier.
Besides, using a 1000 nests is far, far too much. I suspect you are trying to execute something similar to the SQL operator IN (a,b,c,,,). In SharePoint 2010 you can use the operator to do exactly that.