4. Introduction More / additional information of interacting lists Reading and writing items Explanation of the different API’s Ways to develop against list 4
5. SharePoint List APIs/Services Server-side object model Client object model WCF Data Services List Web Services Custom WCF Service / ASP.NET service
6. Server-Side Object Model Easy to use Using Microsoft.SharePoint.dll Core SharePoint DLL Application deployed to or reside on the server 6
8. Client Object Model Client-based DLL Access to SharePoint content from key client technologies .Net, Silverlight, Javascript, Not able to use from non Microsoft platform Similar to the server-side object model Easy to move from client-side to server-side development Combining with sandboxed solutions SharePoint Online Development 8
10. WCF Data Services REST (Representational State Transfer)-based service Lightweight get and post functionality Interacting with Excel spreadsheets Manipulate SharePoint data from different platforms 10
12. List Web Services ASP.NET Web Service For rapid development and deployment Service based application For backward compatibility When possible, avoid this service Migrating from pre-SharePoint 2010 to SharePoint 2010 Ex. /vtI_bin/Lists.asmx /vti_bin/Copy.asmx 12
14. Custom WCF service / ASP.NET Service Custom requirements Easy to realise instead of 2007 14
15. Summary Best practices Avoid use of list web services Migration Client Object Model is the best choice in most of the cases SharePoint Online Development Easy to implement Custom WCF Services in SharePoint 2010 15
16. Follow Ordina…. 16 Share your thoughts via #SOFTC Follow us on twitter: @OrdinaBE Find the presentationsonwww.slideshare.net/ordinaBe Be informed atwww.linkedin.com/company/ordina-belgium
Hinweis der Redaktion
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.