SharePoint 2010 Issue Using Search Web Service

I had written a simple web part for SharePoint 2007 that generates a directory listing of all sites a user has permissions to view.   This web part makes use of the SharePoint search web service to quickly retrieve a listing of sites which are security trimmed to the logged in user.

I decided to test that web part in my new SharePoint 2010 beta development environment and immediately ran into a very cryptic error message: System.ServiceModel.FaultException1[System.ServiceModel.ExceptionDetail].   That was it… no real details to help debugging the problem.   I jumped into the ULS logs for SharePoint 2010 and found a little bit more information:   Exception from HRESULT: 0x80040E01.

I did a few searches and ran across a post on MSDN forums where a person indicated they were getting an error with the same HRESULT when trying to run a search query.   The suggestion was to reduce the RowLimit parameter.   In my instance I wasn’t using RowLimit but I was using <Count>1000</Count> in my CAML string being passed to the QueryEx method of the search web service.   I reduced the count to 500 and tested my web part.   This time it worked perfectly.

It appears that SharePoint 2010’s new resource throttling may be kicking in when I set the count level higher even though I had only 2 items being returned in my query.   SharePoint 2010 puts on the breaks and throws a cryptic exception just because I asked for a maximum of 1000 items even though only 2 would have been returned.

I am hoping that this error message will be enhanced in the RTM version of SharePoint 2010 so we can more easily debug the issue.  I would also like to see documentation on the throttle limit and how an administrator could change that limit if necessary. 

Leave a Reply