sharepoint data anywhere and everywhere by chris beckett - sptechcon

40
info@newsteplearning .com www.newsteplearning. com (425) 522-3727 Professional Learning Programs for Microsoft SharePoint, Office 365 and Windows Azure Understanding and Programming SharePoint Web Services

Upload: sptechcon

Post on 05-Dec-2014

1.463 views

Category:

Documents


0 download

DESCRIPTION

Technical Class:

TRANSCRIPT

Page 1: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

[email protected](425) 522-3727

Professional Learning Programs for Microsoft SharePoint, Office 365 and Windows Azure

Understanding and ProgrammingSharePoint Web Services

Page 2: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

About Chris Beckett

24+10MCMMCT

MCSEMCPD

Solution ArchitectLearning Consultant

and Trainer

[email protected]

@sharepointbits

blog.sharepointbits.com

Page 3: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Agenda

Introduction toSharePoint Web

Services

SOAPWeb Services

Client-SideObject Model REST API

Page 4: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

What is a Web Service?

A software system designed to support interoperable machine-to-machine interaction over a network

W3C

Page 5: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

A Web Services Story1 2 3

4 5 6

Page 6: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Available SharePoint Web Services

• Open Standards

• RPC Model

• Protocol Agnostic

• XML

• Microsoft Proprietary

• Batch RPC Model

• Client Runtime

• XML / JSON

• Open Standards

• REST Model

• HTTP Only

• ATOM / JSON

SOAPWeb Services

Client Side ObjectModel (CSOM)

ODATAWeb Services

Page 7: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SharePoint 2010 Web Service Access

SOAP CSOM ODATA

Lists and Libraries

Site and List Settings

Site Security

Workflow

Search

Managed Metadata

User Profiles

Publishing

Page 8: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SharePoint 2010 Web Service Clients

SOAP CSOM ODATA

JavaScript

Silverlight

.NET

Windows Phone

Other Languages

InfoPath Receive

InfoPath Submit

BCS WCF Connector

Page 9: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SharePoint 2013 Web Service Access

SOAP CSOM ODATA

Lists and Libraries

Site and List Settings

Site Security

Workflow

Search

Managed Metadata

User Profiles

Publishing

Deprecated

Page 10: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SharePoint 2010 Web Service Clients

SOAP CSOM ODATA

JavaScript

Silverlight

.NET

Windows Phone

Other Languages

InfoPath Receive

InfoPath Submit

BCS WCF Connector

Deprecated

Page 11: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Agenda

UnderstandingSharePoint Web

Services

Programming withSOAP-Based

Web ServicesProgramming with

the Client-SideObject Model

Programming withthe ODATA RESTful

Web Services

Page 12: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

What is SOAP?

Created by Microsoft in 1998 / W3C Standard

Protocol Agnostic / Common to use HTTP

RPC Message Pattern (Request/Response)

XML Schema used for Message Structures

Page 13: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SOAP Request Message Format

SOAP Envelope

SOAP Body

Method and Parameters

Page 14: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SOAP Response Message Format

SOAP Envelope

SOAP Body

Response Xml

Page 15: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SOAP Considerations

• All Versions of SharePoint• Ubiquitous• Protocol Agnostic• Language Agnostic

• Access to Enterprise Services

• Designed to work with Proxy• Not JavaScript Friendly• Verbose Xml Data• No Anonymous

Page 16: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

SharePoint Web Service AddressesWeb Service Web Service AddressSearch http://<site>/_vti_bin/search.asmxUser Profiles http://<site>/_vti_bin/userprofileservice.asmxSites http://<site>/_vti_bin/sites.asmxLists http://<site>/_vti_bin/lists.asmxPermissions http://<site>/_vti_bin/permissions.asmxCopy http://<site>/_vti_bin/copy.asmx

31 Public Web Services (25+6) in SharePoint

Page 17: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Service Descriptions

Provides Humans with Operations and Signatures

Page 18: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Web Service Definition Language

?WSDL

Page 19: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Visual Studio Service Reference

SpecifyWeb Service URL

Browse AvailableOperations

Specify ProxyNamespace

Proxy ClassName

Page 20: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Auto-generated Service ProxyCreate Proxy

Instance

Invoke Methods

ProcessOutput

SetCredentials

Page 21: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

spservices.codeplex.com

Page 22: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Programming with SPServices

Create a Parameters Array

Anon Function forComplete

Invoke Library with Parameters

Page 23: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Agenda

UnderstandingSharePoint Web

Services

Programming withSOAP-Based

Web Services

Programming with the Client-SideObject Model

Programming withthe ODATA RESTful

Web Services

Page 24: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

What is the CSOM?

Proprietary Microsoft SharePoint Client API

.NET / Silverlight / WP7 / ECMAScript

Mimics Server-side Object Model

Proprietary Message Transfer Format

Page 25: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

CSOM Architecture

Page 26: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

CSOM Considerations

• Efficient for Batch Operations• Familiar for SharePoint

Developers• Supports LINQ Queries• Works with Anonymous

• Less Efficient for Simple Operations• Unfamiliar to Web

Developers• Limited # of Client Runtimes• Microsoft Proprietary

Page 27: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Context and Authentication (.NET)

Default isWindows

Authentication

Page 28: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

CSOM (ECMAScript)

Create a Context

Load the Context

Execute Async Query

Access Properties

Page 29: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

CSOM (.NET)

Create a Context

Load the Context

Execute Query

Access Properties

Page 30: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

CSOM Request

Protocol is documented, but you don’t want to be

hand-tooling these requests

Page 31: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Client Library Assemblies

* Silverlight located at:

/15/Template/Layouts/Client

.NET assemblies found under

/15/ISAPI

Page 32: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Client Components SDK

Installs all client runtime

components

Page 33: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Agenda

UnderstandingSharePoint Web

Services

Programming withSOAP-Based

Web Services

Programming with the Client-SideObject Model

Programming withthe ODATA RESTful

Web Services

Page 34: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

What is REST?

Representational State Transfer

Web Addressable Resources / Hyperlink-able

Maps CRUD operations with HTTP Verbs

Commonly uses JSON for Data Messages

Page 35: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

REST Considerations

• Efficient for Batch Operations• Familiar for SharePoint

Developers• Supports LINQ Queries• Works with Anonymous

• Less Efficient for Simple Operations• Unfamiliar to Web

Developers• Limited # of Client Runtimes• Microsoft Proprietary

Page 36: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

www.odata.org

Page 37: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

ODATA Operations and Parameters

GET (Retrieve)POST (Create)PUT (Update All Fields)DELETE (Delete)MERGE (Update Specific)

$filter={simple predicate}$expand={Entity}$order by={property}$skip={n}$top={n}$metadata

Operations Parameters

Page 38: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

List Data Service (ECMA Script)

Page 39: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

More Information

Choose the Right API set with SharePoint 2013http://msdn.microsoft.com/en-us/library/jj164060.aspx

Complete Basic Operations with the SharePoint 2013 Client Libraryhttp://msdn.microsoft.com/en-us/library/fp179912.aspx

Programming using the SharePoint 2013 REST Servicehttp://msdn.microsoft.com/en-us/library/fp142385.aspx

SharePoint 2010 Web Serviceshttp://msdn.microsoft.com/en-us/library/ee705814(v=office.14).aspx

Accessing SharePoint 2010 Lists by Using WCF Data Serviceshttp://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx

Page 40: SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon

Questions

Thank you for attending!

Please complete your evaluations. Your feedback is appreciated

chris@newsteplearning.

com

(425) 522-3727

@sharepointbits

blog.sharepointbits.co

m