Monday, August 05, 2013

SharePoint 2013 Strategy client object model (CSOM) tips


Hi Folks,


I have consolidated some useful tips about CSOM in SharePoint 2013 from training vidoes i found on MSDN and i decided to put it on a blog post so it is easier and faster to get your notes out of them.


1)      In SharePoint 2010, you can’t access client.svc to conduct client calls to SharePoint Object model, instead you use .NET, Silverlight, or JavaScript client library to conduct client call to the WCF client.svc on the server from your client applications.

2)      In SharePoint 2013, you can directly access client.svc from REST clients.

3)      In SharePoint 2013, Client.svc accepts HTTP verbs such as: GET, POST , PUT.

4)      Extended CSOM API that supports more functionality such as: Search, Taxonomy, Publishing, Analytics, Workflow and E-Discovery.

5)      “_api” is a new alias for “_vti_bin/client.svc” to access the end point.

6)      CSOM code in SharePoint 2010 should be migrated to SharePoint 2013 CSOM with no issues.

7)      ListData.svc still available for backward compatibility applications from SharePoint 2010 into SharePoint 2013.

8)      It is not recommended to use ListData.svc in your SharePoint 2013 CSOM code, Use OData API instead, check #12.

9)      You can use fiddler to monitor client queries in CSOM code, especially when you call ExecuteQuery() in CSOM code.

10)   Using IE developer tool and Fiddler are essential when you code using JavaScript to call sp.js in CSOM. It also allows seeing the details of the request and JSON response content.

11)   FormDigest is being created the first time when calling ExecuteQuery for the first time; this is being used on all consecutive calls.

12)   Simply OData URIs as follows to access the web:


Simplified: http://www.contoso.com/_api/web

To access “Announcements” list:


Hope this notes would help.




Reference:
SharePoint 2013 CSOM and OData API Training Videos