Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am writing a Silverlight control which will display the data from SharePoint list for use in SharePoint 2010 site.

I am considering wheather to use Client Object Model or SharePoint web services to achieve this task ?

Are there any criteria or performance considerations in deciding which to use when ?

Update

There has been a post on this topic by author of SPServces. Including the link below

http://sympmarc.com/2012/04/12/when-to-choose-spservices-vs-the-client-side-object-model-csom/#comment-23489

share|improve this question

5 Answers

up vote 11 down vote accepted

If you can you should use the Client Object Model (CSOM) - it does not support that many features as the web services but are superior in a number of ways such as:

  • data types
  • batching of commands (more efficient usage of bandwith)
  • optimization of data loaded (more efficient usage of bandwidth)
  • more similar to the server side object model in terms of programming (the web services are in most cases just huge chunks of undocumented XML you need to parse)
  • ...

So, for performance you will likely suceed better using CSOM

share|improve this answer

You actually calling a web service when you use client object model according to this link. Of course use web service is more direct but i dont really care about performance penalty by using Client Object Model. The more concern is productivity improvement by using client object model. But if you more comfortable using web service, you can use it.

share|improve this answer

Client Object Model was designed to work mainly with list data, so the API is somehow limitted. Working with web services does not always mean parsing XML data, you can use REST API (ListData.svc) that will return JSON output. Some webservices allow to switch between SOAP and JSON response format. So, my advice would be use Client Object Model when suitable (lists, security), and in other scenarios call SharePoint web services.

share|improve this answer

I think using the Client-Object Model is the suitable option because as it's meant to be used with tools like Silverlight, .NET, etc.

Also it provides more benefits.

share|improve this answer
1  
Actually using web services gives you more option and access to more features, but CSOM is the preferred way if you're limiting yourself to lists and SharePoint Foundation stuff – Wictor Wilen MCA MCM MVP Jan 2 '12 at 15:42

This MSDN article should also be listed when answering this question:
Deciding Which SharePoint 2010 API to Use

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.