Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

May 26, 2010 10:05 AM

SharePoint 2010's Client Object Model

It's now easier to work with SharePoint data
SharePoint Pro
InstantDoc ID #125028
Rating: (16)

Conditional scope: As in standard development done on the server, coding conditions by relying on exceptions being thrown is not a great idea. Thankfully, the client object model gives you a way to execute code conditionally using the ConditionalScope object. When executing code on the server, this object lets you execute code provided a certain condition is met. The ConditionalScope object is available in both of the managed client object models but not in the ECMAScript client object model. 

Authentication: The client object models have a default authentication built in. Both of the managed client object models authenticate using the default credentials of the authenticated user running the code. However, in the case of the .NET client object model, you can use the ClientContext.AuthenticationMode property to change the authentication to use anonymous or forms-based authentication. 

Depending on the authentication mode specified, the client object model calls the SharePoint authentication Web service (http://[...]/_vti_bin/Authentication.asmx), then obtains and sets a cookie that it uses for future calls. 

Changing the authentication mechanism is allowed only in the .NET client object model. The ECMAScript client object model uses the authentication of the page it's hosted within; it cannot change its authentication. 

Implementing the Client Object Model

Before using the client object model, you need to know how an application must be configured to leverage the model. Although the three client object models share similarities, a few subtle differences exist in terms of limitations and implementations. 

.NET client object model: The .NET client object model is designed for use in applications that will run off the SharePoint servers and connect to SharePoint remotely. This could include applications running on a laptop or integrated into a bigger system that needs to communicate with SharePoint. These applications can be either x86 or x64 and require the .NET Framework 3.5 SP1 or higher. 

Custom .NET applications will need to add references to two assemblies in order to use the client object model. These two assemblies are found on the SharePoint server: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI:

  • Microsoft.SharePoint.Client.dll—contains the client object model.
  • Microsoft.SharePoint.Client.Runtime.dll—handles all communication between the client and SharePoint server.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.