Getting Enough REST?
The SharePoint 2013 OData Services




                                 By: Hilton Giesenow
                                       Experts Inside
Server OM: an Open Playing Field
Remote Access
SharePoint 2007 Web Services
1.    Alerts                          13.   Forms Services Web service       27. Search Web service
2.    Area Web service                14.   Imaging Web service              28. Users and Groups Web service
3.    Authentication Web service      15.   Lists Web service                29. User Profile Change Web
4.    BDC Fields Resolver Web         16.   Meetings Web service                 service
      service                         17.   Official File Web service        30. User Profile Web service
5.    BDC Web service                 18.   People Web service               31. Versions Web service
6.    CMS Content Area Toolbox        19.   Permissions Web service          32. Views Web service
      Info Web service                20.   Published Links Web service      33. Web Part Pages Web service
7.    Copy Web service                21.   Publishing Service Web service   34. Webs Web service
8.    List Data Retrieval Web service 22.   Search Web service               35. Workflow Web service
9.    Document Workspace Web          23.   SharePoint Directory
      service                               Management Web service
10.   Excel Services Web service      24.   Sites Web service
11.   Forms Web service               25.   Slide Library Web service
12.   Forms Services proxy Web        26.   Search Crawl Web service
      service
So it Was “All Good”?




   What do YOU think?
SOAP




    SharePoint Developer

SOAP is BLOATED
public Client GetClientByID (int id)




SOAP Is Limiting
public XMLGoo GetListItems (XMLGoo)
Why re-invent the wheel?
REST Service
Client-Side OM
http://myservice/Customers
    http://myservice/Customers(„ALFKI‟)
    http://myservice/Customers(„ALFKI‟)/Orders(3)/Price

http://myservice/Customers?$filter=startswith(FirstName,'H')
REST
CSOM




       Which One to Choose?
User
           Search     Taxonomy      Feeds   Publishing    Lists
Profiles



                                                         Business
Sharing    Workflow   E-Discovery   IRM     Analytics
                                                           Data




                The 2013 “Merger”: Client.svc
Why REST?
REST Service Style
Client-Side OM
         Dev

        Dev Skill

Strong Typing (?)

    WinRT Apps
QoS
Connectivity

                                    Security
  Latency




            Calling Long Distance
Perf Tip #1: Limit the data
Perf Tip #2: Limit the calls
Perf Tip #3: Fool the User
Operation    HTTP Method
Read         GET
Create       POST
Update       PUT / MERGE / PATCH
Delete       Delete




Writing Back - CrUD
X-RequestDigest
 0x4D788385666FD5F9EF30EF3B61A1208C68626B72CBB82FA4DDE4A9
 5EE4618A589DB21AC810F05D2507A0FACBDD6C250FB20362320A3F7
 CD1ED74A8B4606FDA36,04 Feb 2013 13:22:52 -0000



Form Digest: Keeping out the „Riff-Raff‟
Optimistic Concurrency
OAuth in Office 365
                                                              1


                                                              2


                                                              3
                SharePoint 2013
                Content Server                                4
           1                      2

           4                      3                           5


End User                              Authentication Server
                                                              6
                     8   9



           5                      6                           7
                  Client App
           10                     7
                                                              8




                                                              9




                                                              10
Cross-Domain Queries
Key Takeaways
                   SOAP / CSOM   REST
                                          Other options
                                              ASMX, CSOM
                                             Roll-your-own




Going back                              Know your stack!
CrUD - Digest                                     Payload
Concurrency                                   Limiting calls
                                                     Async
Advanced Topics
    More on Paging
        Social Safety
       Async in .Net
           Batching
 Paging & Counting
Relationships in .Net

Getting Enough REST? Understanding the SharePoint 2013 REST / ODATA Services

  • 1.
    Getting Enough REST? TheSharePoint 2013 OData Services By: Hilton Giesenow Experts Inside
  • 4.
    Server OM: anOpen Playing Field
  • 5.
  • 6.
    SharePoint 2007 WebServices 1. Alerts 13. Forms Services Web service 27. Search Web service 2. Area Web service 14. Imaging Web service 28. Users and Groups Web service 3. Authentication Web service 15. Lists Web service 29. User Profile Change Web 4. BDC Fields Resolver Web 16. Meetings Web service service service 17. Official File Web service 30. User Profile Web service 5. BDC Web service 18. People Web service 31. Versions Web service 6. CMS Content Area Toolbox 19. Permissions Web service 32. Views Web service Info Web service 20. Published Links Web service 33. Web Part Pages Web service 7. Copy Web service 21. Publishing Service Web service 34. Webs Web service 8. List Data Retrieval Web service 22. Search Web service 35. Workflow Web service 9. Document Workspace Web 23. SharePoint Directory service Management Web service 10. Excel Services Web service 24. Sites Web service 11. Forms Web service 25. Slide Library Web service 12. Forms Services proxy Web 26. Search Crawl Web service service
  • 7.
    So it Was“All Good”? What do YOU think?
  • 8.
    SOAP SharePoint Developer SOAP is BLOATED
  • 9.
    public Client GetClientByID(int id) SOAP Is Limiting
  • 10.
  • 11.
    Why re-invent thewheel? REST Service Client-Side OM
  • 12.
    http://myservice/Customers http://myservice/Customers(„ALFKI‟) http://myservice/Customers(„ALFKI‟)/Orders(3)/Price http://myservice/Customers?$filter=startswith(FirstName,'H')
  • 14.
    REST CSOM Which One to Choose?
  • 15.
    User Search Taxonomy Feeds Publishing Lists Profiles Business Sharing Workflow E-Discovery IRM Analytics Data The 2013 “Merger”: Client.svc
  • 17.
    Why REST? REST ServiceStyle Client-Side OM Dev Dev Skill Strong Typing (?) WinRT Apps
  • 19.
    QoS Connectivity Security Latency Calling Long Distance
  • 21.
    Perf Tip #1:Limit the data
  • 22.
    Perf Tip #2:Limit the calls
  • 23.
    Perf Tip #3:Fool the User
  • 24.
    Operation HTTP Method Read GET Create POST Update PUT / MERGE / PATCH Delete Delete Writing Back - CrUD
  • 25.
    X-RequestDigest 0x4D788385666FD5F9EF30EF3B61A1208C68626B72CBB82FA4DDE4A9 5EE4618A589DB21AC810F05D2507A0FACBDD6C250FB20362320A3F7 CD1ED74A8B4606FDA36,04 Feb 2013 13:22:52 -0000 Form Digest: Keeping out the „Riff-Raff‟
  • 26.
  • 29.
    OAuth in Office365 1 2 3 SharePoint 2013 Content Server 4 1 2 4 3 5 End User Authentication Server 6 8 9 5 6 7 Client App 10 7 8 9 10
  • 30.
  • 31.
    Key Takeaways SOAP / CSOM REST Other options ASMX, CSOM Roll-your-own Going back Know your stack! CrUD - Digest Payload Concurrency Limiting calls Async
  • 34.
    Advanced Topics More on Paging Social Safety Async in .Net Batching Paging & Counting Relationships in .Net

Editor's Notes

  • #2 Good resource: http://msdn.microsoft.com/en-us/library/fp142385.aspx
  • #12 Client-Side OMKinda-like SOM3 Versions.NetJSSilverlightREST/ODataStandards-basedOpen to anyoneWidely known
  • #14 Demo Reminder Script:Explain ListData.svcvsClient.svcOpen browser to listdata.svcShow lists -> one list -> one list item -> one field (CreatedBy)Show Query - $filter=StartsWith(Title,’[X]’)Show SelectShow OrderByShow Fiddler (JSON - application/json;odata=verbose)Show Client.svc/_vti_bin/client.svc -> /_api_api/web/getAvailableWebTemplates(1033)_api/social.following/my/Followed(types=4)C# Proxy - uses “LINQ TO WCF Data Services”Generating proxyWhere,OrderByJS Example – basic, then more complex
  • #15 Client-Side OMKinda-like SOM3 Versions.NetJSSilverlightREST/ODataStandards-basedOpen to anyoneWidely known
  • #16 Good:MUCH larger footprint, ESPECIALLY for REST service More MS Investment? One less “moving part”? New API for WPhoneBad: Not like-for-like (CSOM still does more, like Taxonomy fields) Less “RESTful” no $metadata (for now?) NO LONGER STANDARDS COMPLIANT!
  • #17 $inlinecount=allpages, $skip, $take, $format=json, $concat, $metadatahttp://schemas.microsoft.com/ado/2007/08/dataservices/related/Contact
  • #19 But sometimes, nothing beats knowing how to use something properly…
  • #21 Limit RowsLimit ColumnsSome effectsLimit CallsCaching (do your own)“Expand”BatchingFool the UserAsync
  • #25 (Can be tunneled in POST commands)
  • #27 Uses “Etags”
  • #28 ConcurrencyMERGE vs. PUT
  • #29 Joke slide – nothing of value here