What is difference between listdata.svc and clients.svc in SharePoint? Both are webservices and can be used to fetch list items..
I have read that any serverside object model or clientside object model or javascript model internally makes calls to the clients.svc, is this true?
2 Answers
Sharepoint Client OM uses Client.svc WCF service to communicate with SharePoint Server. Client.svc service uses Server OM as per client request and return result to the client in JSON format. So your 2nd point is correct clientside object model or javascript model internally makes calls to the clients.svc. Serverside side object model does not use client.svc.
While To get the data from Sharepoint list via REST we use listData.svc.
http://<sharepoint-server>/_vti_bin/ListData.svc/<ListName>
For more details:
http://msdn.microsoft.com/en-us/library/office/jj164060(v=office.15).aspx
-
To get the data from Sharepoint list via REST we can also use the _vti_bin/clients.svc which is nothing but the /_api/. Then, what is purpose of listData.svc, it is for backward compatibility with 2010 only?– variableCommented Jul 16, 2014 at 5:20
-
1You can target either the listdata.svc (for list data only) or you can target the same client.svc that supports the OData interface for access to all SharePoint entities in addition to list data.– AanchalCommented Jul 16, 2014 at 5:23
-
Yes, ListData.svc is only there for backward compatibility where clients may have been written against earlier versions of SharePoint. Use _api (i.e. _vti_bin/Client.svc) for REST calls moving forward.– SPDoctorCommented Apr 18, 2015 at 20:33
-
ListData.svc
- only if list data is needed
Client.svc
- List data and oData operation
The "_api" is friendly name, since it's easier to read. The old SharePoint 2010 /_vti_bin/ListData.svc
is still there in SharePoint 2013, and is handy if only List data is needed.
In SP2010 - /_vti_bin/ListData.svc
In SP2013 is replaced
From: /_vti_bin/Client.svc
To: /_api/