odata - interop events · pdf filesap netweaver gateway sap openui5 sap ... to an external...

42
OData The best way to REST Sam Xu Software Engineer II Microsoft

Upload: phamduong

Post on 14-Feb-2018

240 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

ODataThe best way to REST

Sam Xu

Software Engineer II

Microsoft

Page 2: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

• SDE II at Microsoft Shanghai ZiZhu

• Almost 4 Years in Microsoft

• 3+ years in OData Team

• Focus on ODL, Web API OData

• http://github.com/xuzhg

About me

Page 3: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Agenda

• What is OData?

• Where is OData?

• Who provides OData?

• Why choose OData?

Page 4: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

What is OData?

Page 5: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Web Services – SOAP vs REST

SOAP REST

Overhead Heavyweight Lightweight

Metadata Complex Simple

Operations SOAP envelope HTTP VERB (Get, Post…)

Resource identity SOAP envelope HTTP URI

• REST: Representational State Transfer• SOAP: Simple Object Access Protocol

Page 6: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Open Data Protocol (OData)

• An open protocol of OASIS standard to allow the creation and consumption of queryable and interoperable RESTful APIs in

a simple and standard way.[ ]• OASIS standard (2014/3/17)• HTTP Request/Response, Method, Status codes, etc• Entity Data Model (EDM)• JavaScript Object Notation (JSON)• Rich Query Options ($filter, $expand, etc)• ……

Page 7: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData Spec

http://odata.org

Page 8: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Where is OData?

Page 9: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Microsoft

Microsoft

Office 365 API

Azure APIsExcel and

PowerQuery

“The Office 365 APIs follow REST and OData 4.0 standards for data transport, and use the OAuth 2.0 standard for authentications and authorization.”

“Azure Search service API uses Open Data Protocol (OData) for index queries. Azure Search supports OData version 4.”

“Microsoft Power Query for Excel’s OData V4 support leverages the built-in functionality of the OData service to bring only the relevant data back into Excel. ”

More …

Page 10: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

SAP NetWeaver Gateway SAP OpenUI5

SAP

“SAP NetWeaver Gateway provides an API that is designed to function in just such a manner; and it does so using the OData protocol.”

“It eases your development with a client-side HTML5 rendering library including a rich set of controls and supports data binding to different models (JSON, XML and OData).”

Page 11: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Salesforce’s OData product:

Lightning Connect & DataDirect Cloud

“With external objects you can connect to an external data source like SAP or any other database that uses OData protocol or a simple URL.”

Page 12: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Who provides OData?

Page 13: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData libraries by Microsoft

Source: https://github.com/OData/Document: http://odata.github.io/

Page 14: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData libs on Nuget.org

Page 15: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData libraries by Apache

http://olingo.apache.org/

Page 16: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData libraries by JayData

http://jaydata.org/

Page 17: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData libraries by Breeze

http://www.getbreezenow.com/documentation/odata

Page 18: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Why choose OData?

Page 19: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Advantages

OData

OpenStandard

Interoperability

RESTfulness

Queryability

Industry practice

Community

Page 20: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData is an open standard

Page 21: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Standardization history

V1.0 (2007)

V2.0 (2009)

V3.0 (2012)

V4.0 (2014) V4.0 (will submit to ISO this year)

Page 22: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData OASIS TC participants

Page 23: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData provides interoperability

Page 24: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Openness leads to interoperability

Agreed resource identification method

Agreed resource representation

Agreed resource operation

Page 25: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData APIs are RESTful

Page 26: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData follows REST principles

Page 27: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData provides API queryability

Page 28: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Rich system query options

• To narrow the result set$filter

• To narrow the set of properties$select

• To do client side paging$top and $skip

• To sort the result set$orderby

• To take advanced results$count, $search,

$value, $format…

Page 29: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData represents industry practices

Page 30: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Specification covering every aspect of REST

Model representation

Batch & asynchronous

requests

VersioningChange

requesting

URL conventions

Queries OperationsData

annotation…

Entity Data model

Http Verbs

Context URL

OData Version

Query Options

Page 31: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Industry practices in different businesses

Enterprises

• Microsoft

• SAP

• Salesforce

• IBM

• Schneider

Electrics

SaaS providers

• Blue garden

• K2

• Creditpoint

• Questionmark

• Splunk

Integration service

providers

• Jitterbit

• ODataHQ

• Mulesoft

• Juhe Data (聚合

数据)

• Progress software

Library and tooling

implementers

• JayData

• Apache

• Breeze

• Gizur

• Pragmatiqa

• Tableau

http://www.OData.org/ecosystem/

Page 32: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData has a prosperous community

Page 33: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Three personas and their needs

RESTful API/client

Developers

• Tutorials

• Documentations

• Community

• Libraries

• Tooling

Business decision

makers

• Success stories

• Customers

• Business benefits

API advocates

• A good protocol

to advocate and

learn from

• Everything the

first two

personas need

Source Codes

Page 34: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Home of the OData community

http://www.odata.org/

Page 35: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

DEMO

Page 36: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Basic OData URI examples

http://services.odata.org/V4/TripPinService

http://services.odata.org/V4/TripPinService/$metadata

http://services.odata.org/V4/TripPinService/People

http://services.odata.org/V4/TripPinService/People('russellwhyte')

Page 37: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Advance Query option examples

http://services.odata.org/V4/TripPinService/People?$filter=startswith(LastName,'A')

http://services.odata.org/V4/TripPinService/People?$select=UserName

http://services.odata.org/V4/TripPinService/People?$top=2&$skip=1

http://services.odata.org/V4/TripPinService/People?$orderby=FirstName%20desc

http://services.odata.org/V4/TripPinService/People?$filter=Friends/any(e0:startswith(e0/FirstName,'W') and Friends/any(e1:(LastName eq 'Alfred')))&$select=UserName,Friends

Page 38: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Summary

Page 39: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

OData - The best way to REST

• Open protocol, open source libraries, open

communityOpen

• Protocol built on REST principlesRESTful

• Available on any device, any platform, anywhereUbiquitous

• Build on industry best practices, supported and

used by Enterprises that serves billions of usersPractical

Page 40: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Resources

• OData communityHome: • http://www.OData.org

• OASIS OData TC Home: • https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=OData

• OData on GitHub: • https://github.com/OData/

• OData V4 sample servicesTripPin (read & write):• http://services.OData.org/V4/TripPinServiceRW

• OData team of MicrosoftMail to: • [email protected]

Page 41: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Go to:

Page 42: OData - Interop Events · PDF fileSAP NetWeaver Gateway SAP OpenUI5 SAP ... to an external data source like SAP or any other database that uses OData protocol or a simple URL

Thank You!