0

We are querying SharePoint 2013 webservice method - GetListItems to fetch list of items in a list but it is returning 0 items. The strange thing is same piece of code was working for SharePoint 2010 as it used to return files list in a specified sharepoint list, however since upgrade to SharePoint 2013, it is returning 0 items without even throwing any exception.

Following are the parameters being passed to GetListItems method.

<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>
Ali
  • 5,499
  • 7
  • 25
  • 28

1 Answers1

0

It looks a subtle change has been made in SharePoint2013 in the way it perceives tag. Instead of mentioning folder name, we had to mention complete folder path for it to work.

Modified parameter list which worked:

<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>
Ali
  • 5,499
  • 7
  • 25
  • 28