Client Object Model & REST Improvements in SharePoint 2013 Jerry Yasir SharePoint Server MVP.
Download ReportTranscript Client Object Model & REST Improvements in SharePoint 2013 Jerry Yasir SharePoint Server MVP.
Client Object Model & REST Improvements in SharePoint 2013 Jerry Yasir SharePoint Server MVP Who Am I? SharePoint Server MVP Since 2010 SharePoint Practice Lead at US TECH Solutions (Jersey City, NJ) Microsoft Certified Trainer (MCT) since 2008. MCSE SharePoint 2013 – Waiting Results MCITP SharePoint Admin 2010, MCPD SharePoint Developer 2010 & MCTS SharePoint 2010 Configuration & Development MCTS WSS 3.0, SharePoint Server 2007, MCITP, MCTS Silverlight 4 Development, Project Server 2007 & 2010, MCTS Project Professional 2007 & 2010, MCPD.NET, MCSD.NET MCAD.NET Email: [email protected], Twitter: @jerry_yasir Facebook: yasir.attiq (Jerry Yasir) Blog: http://jerryyasir.wordpress.com Overview – US Tech Solutions 3 Leading global consulting company, offering domain led IT Consulting services for more than 12 years . Development centers and COE’s in the US and India. IT consultants deployed globally on various projects. Access to a unique portfolio of innovative technologies that reduce IT project cost, timescales and risk. A large and diverse pool of resources with expertise on various technologies and at various levels. Specially Designed Skill & Career Development Programs Technology partnerships with leading OEM’s like Microsoft, Oracle and IBM. ©US Tech Solutions, 2012 www.ustechsolutions.com Agenda Overview Client OM Intro DEMO Summary REST Q&A CSOM in 2010 CSOM in SharePoint 2010 Issues with CSOM • No Direct Access to client.svc Web Service • Must use a Proxy or Supported End Points • Supports .NET Silverlight & JavaScript Managed OM – Is Easy Silverlight OM? – Is Easy JavaScript OM? – Is Not Easy SharePoint 2010 CSOM Architecture /_vti_bin/client.svc Server Execute Query Client .NET CLR Library Silverlight C Library Custom Client Code JavaScript Library How CSOM works CSOM Changes in 2013 Changes in SharePoint 2013 Client.svc with REST Clients • Direct Access to client.svc Web Service • Access HTTP GET, PUT, Merge, POST Requests • OData Implementation • Writing Code from NON Microsoft Apps For More Information http://tinyurl.com/SP2013Odata • New APIs for Server Functionality • API for Windows Phone Development New CSOM API Support User Profiles Sharing Search Taxonomy Workflow E-Discovery Support both Server Side code and REST Feeds IRM Publishing Lists Analytics Business Data SharePoint 2013 CSOM Architecture _api Server Execute Query Client .NET CLR Library Silverlight C Library JavaScript Library Custom Client Code OData Changes in SharePoint 2013 CSOM • Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.RunTime.dll • Available in SharePoint Foundation • contains the core classes Demo Managed Client OM Demo JavaScript Client OM REST Overview What’s REST and Why? Simple and Easier to Use • Easier than SOAP Based WS’s • Higher Productivity using JavaScript and JQuery • Results as JSON and ATOM • Everything is URL • Results can be cached on Proxy Servers. REST in SharePoint 2010 REST in SharePoint 2013 Replace • http://intranet/_vti_bin/client.svc/web with • http://intranet/_api/web/ • Lot more simple URL • Helps in 256 Character Limit of URLs in browser • ListData.svc is still there for backword compatiability • OLD Aps will still work but needs to be updated Client OM and OData What is OData? More Information @ http://www.odata.org/ OData Terms and Concepts OData Described in Entity Data Model by Collection Entity Set A Navigation Property on an entity type that identifies a collection of entities Entry Entry type Note: May be Part of a type Hierarchy Property of an Entry Primitive or complex Entity type property Complex Type Complex Type Link A Navigation Property defined on an entity type Service Operation Function Import OData Implementation Details OData Maps CRUD Operations to HTTP Verbs Methods will be mapped into either More Information @ http://www.odata.org/ URLs Resource Path – SQL Table or Web or List REST – Return ATOM XML vs. JSON ATOM-PUB XML • Verbose • Easier to Read • ACCEPT = application/atom+xml • Condensed notation • Smaller payload • ACCEPT = application/json;odata=verbose; Managing Objects to Resources Example REST URLS http://Intranet.consoto.com/_api/web/ http://Intranet.consoto.com/_api/web/Lists http://Intranet.consoto.com/_api/web/Lists/getByTitle(‘Customers’) http://Intranet.consoto.com/_api/web/getAvailableWebTemplates(lcid= 1033 http://Intranet.consoto.com/_api/web/ http://intranet.consoto.com/_api/web/Lists/getByTitle(‘Customers’)/Items (0)/?$select CustomerName,CustomerId,Address Demo : REST in Browser Demo : Using Fiddler Demo : OData in Code Summary CSOM Now Covers More Important for App Development REST Improved Syntax Easy to Use with JavaScript than C# Some Great Resources http://msdn.microsoft.com/en-us/library/jj164060.aspx http://msdn.microsoft.com/en-us/library/jj163201.aspx http://msdn.microsoft.com/en-us/library/jj164022.aspx http://msdn.microsoft.com/en-us/library/jj163800.aspx http://msdn.microsoft.com/en-us/library/fp142385.aspx http://msdn.microsoft.com/en-us/library/fp142380.aspx http://msdn.microsoft.com/en-us/library/fp142386.aspx http://msdn.microsoft.com/en-us/library/jj193034(v=office.15).aspx http://code.msdn.microsoft.com/office/SharePoint-2013-Perform-a1bf3e87d/view/SourceCode#content http://msdn.microsoft.com/en-us/library/jj860569.aspx Q&A Thank You