Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
An overview of the SharePoint 2010 Client Object Model - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

by Deepak

2014-07-15

1. Introduction to Client Object Model.

Client Object Model is nugget feature of SharePoint 2010. It is the subset of server object model which defined in Microsoft.sharepoint.dll it is used to manipulate and consume share point data. Client object Model Implement on Window communication Foundation (WCF) service (…/_vti_bin/client.svc)

Note:

  1. You Need Microsoft.sharepoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll For working with client object Model
  2. Location of dll  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI
  3. You Need Microsoft.SharePoint.Client. Namespace on working with client object Model
  4. Client Object Model Classes are as follows

ClientContext : ClientContext class is used to context information about such objects as the current web application, site, site collection, or server version.

Site : site class is used to get the site collection.

Web :web class is used to get the web on current site collection.

List :List is used to get the list.

ListItem :ListItem class is used to get the ListItem.

 2. How Client Object Model Work?

The Client OM send request as an XML format and server will return a JSON (java script Object Notation) which is converted to the appropriate Object Model.

Following diagram is the easier way to access SharePoint 2010 data using Client Object Model

Client.svc:

Client object model is WCF Web Service which is responsible for Communicating between client object model and share Point Data. Client.svc is located along with all other SharePoint Web Services. The response from Client.svc Web Service is sent as JSON format.

Client.SVC service has one method (ProcessQuery ) which takes SteramObject

ProcessQuery method found in Microsoft.SharePoint.Client.ServerRuntime.dll and private class ClientRequestServiceImpl

Location of client.svc service: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Client.SVC

 3. Why We Use Client Object Model?

Share point installation is not required on development machine only you need to required dll’s if you are develop window application or any other application

Less deployment problems and client object model is very easy for end user

Flexibility in language: you can use three different Language for Client object model

Microsoft .NET

Silverlight

ECMA Script (JavaScript /JScript)

Optimization in query speed: In Client OM, you do not need to install the SharePoint Server required by the Server Object Model. Thus Client OM provides much ease to the end user.

Example of Client Object Model (.Net Managed)

//Method Add items into list

private void AddNewListItem()

{
    var clientContext = new ClientContext(“your site URL/”);
    var list = clientContext.Web.Lists.GetByTitle(“ListName”);
    var param = new ListItemCreationInformation();
    var newItem = list.AddItem(param);
    newItem["Name"] = “Deepak Chauhan”;
    newItem["Address"] = "India”;
    newItem.Update();
    clientContext.ExecuteQuery();
}

 

(Visited 264 times, 1 visits today)

About the author 

Deepak

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.