When you’re developing applications that running on the server, you can leverage the server-side OM that is exposed using the microsfot.Sharepoint.dll. For example A simple WPF based application.Tooks a number of string inputs from the WPF UI and used the serverside OM. The code leverages the using statements to set the context for the sharepoint site and then sets the Web to allow updates? Creates an SPList object and SPListitem object, and the proceeds to set the specific column fields with the data that was entered . By the users Finally, the update methode is called to add the data tot the list.
Client Object Mode (OM)I think Client Object Model is the best choice in most of the cases. If you want to access SharePoint data from SharePoint webpart, then you can use Client OM (EcmaScript) to access data in SharePoint. If you are trying to access SharePoint data from Silverlight then you can use Client OM for Silverlight. And most of all you can use Managed Client OM, in supported .net language to access SharePoint data. So Client OM is surely your first choice. But in many cases you can’t use Client OM, especially in cases where you are trying to access SharePoint data from non-Microsoft platform, like Java. Also if your migrating your application from SharePoint 2003/2007 and you are already using asp.net web service, then you don’t have much choice but to use the legacy web services.
How it worksFor both of the previous exercises, You used the client side object model to read data from sharepoint list and write back to the sme list. In many ways, the undelaying calls for sharepoint don’t necessarily change. For example, the client object model leverage the services that are native to sharePoint beneath the covers to make the call into sharepopint . However, this is abstracted away from you.
SharePoint WCF Services (REST-based)The new addition of extensibility point in SharePoint 20l10 is WCF services. If you are planning to manipulate SharePoint data from different platforms, like Java, then these WCF services are the excellent option to go with. If you install WCF data service updates, then these WCF services enable REST-based request processing. For more information on REST-based interface of SharePoint WCF services, please follow the MSDN link. You can also use these WCF services from .net applications. You can get the help from MSDN on how to use these WCF services in .net applications. Few new WCF services available in SharePoint 2010, are listed below:/_vti_bin/ListData.svc/_vti_bin/Client.svc
How it works.The RESTfull services work in a slightly different way than the other ways you’ve seen in this chapter.Specifically , they leverage the listdata svc service and Data services to treat SharePoint lists as data constructors.The querying against the list works similarly to other ways in which you querying entities. You use linq as the standard way to query and filter the data, and then manipulate the data into your application.
Asp.Net Web ServicesSharePoint 2007 comes with built-in web services. These legacy web services are still in SharePoint to support backward-compatibility but whenever you have the option to avoid them, please do so. The only reason I see to use these legacy web services is for applications migrating from pre-SharePoint 2010 to SharePoint 2010. Maybe this is the last version of SharePoint with the support of the legacy web services (at least I hope so). Few legacy asp.net services are listed below:/_vit_bin/Lists.asmx/_vit_bin/Copy.asmxCalls the lists from Various ways of client - applications
Custom WCF ServiceIn real world, we rarely happy with out of the box functionalities. We need to customize a lot to happy our clients. Similarly we may need to develop our own WCF services. Writing a custom asp.net web service in SharePoint 2007 was a very difficult task. But in SharePoint 2010, writing a custom WCF service is much easier now. If you install Community Kit for SharePoint (CKS) Visual Studio extension from CodePlex, you can develop a custom SharePoint Service easily. There’s also manual process of developing custom WCF Server in SharePoint described in MSDN: WCF Services in SharePoint and Creating Custom WCF Service. I’ll try to post more details on how to use CKS add-in to develop custom WCF service in another post.
Ordina SOFTC Presentation - Developing against SharePoint 2010 Lists
Developing against SharePoint Lists<br />Onne Zuur<br />Onne.Zuur@ordina.be<br />
WCF Data Services<br />REST (Representational State Transfer)-based service<br />Lightweight get and post functionality<br />Interacting with Excel spreadsheets<br />Manipulate SharePoint data from different platforms<br />10<br />
Demo WCF Data Services<br />DEMO<br />11<br />
List Web Services<br />ASP.NET Web Service<br />For rapid development and deployment<br />Service based application<br />For backward compatibility <br />When possible, avoid this service<br />Migrating from pre-SharePoint 2010 to SharePoint 2010<br />Ex. /vtI_bin/Lists.asmx /vti_bin/Copy.asmx<br />12<br />
Demo List Web Services<br />DEMO<br />13<br />
Custom WCF service / ASP.NET Service<br />Custom requirements<br />Easy to realise instead of 2007<br />14<br />
Summary<br />Best practices<br />Avoid use of list web services<br />Migration<br />Client Object Model is the best choice in most of the cases<br />SharePoint Online Development<br />Easy to implement Custom WCF Services in SharePoint 2010<br />15<br />
Follow Ordina….<br />16<br />Share your thoughts via #SOFTC <br />Follow us on twitter: @OrdinaBE<br />Find the presentationsonwww.slideshare.net/ordinaBe<br />Be informed atwww.linkedin.com/company/ordina-belgium<br />