+ All Categories
Home > Technology > OData – Super Cola W3

OData – Super Cola W3

Date post: 27-Jan-2015
Category:
Upload: comunidade-netponto
View: 126 times
Download: 0 times
Share this document with a friend
Description:
 
26
OData – A Super Cola W3! Jorge Gonçalves & Manuel Costa http://netpont o.org 34ª Reunião Lisboa - 08/12/2012
Transcript
Page 1: OData – Super Cola W3

OData – A Super Cola W3!Jorge Gonçalves & Manuel Costa

http://netponto.org34ª Reunião Lisboa - 08/12/2012

Page 2: OData – Super Cola W3

Jorge GonçalvesFormador responsável .NET na Rumos SAFundador da Consultora SimpleFactorAdministrador de Sistemas na DGITAAnalista Programador (Altitude Software, BES, BCP, ...)

Manuel CostaConsultor .NET na PT Sistemas de Informação S.A. na área do Portal Web de Vendas da PT. Co-fundador da Factor Digital Informática em 2000, onde desenvolveu sobre plataformas web para a Microsoft, a TMN, a Priberam, os Hotéis Dom Pedro, a Nestlé… Sempre em .NET

Page 3: OData – Super Cola W3

Agenda: OData – The Web “Glue”!• The What’s and Why’s

• CRUD: “REST in peace”

• Writing OData Services With .NET

• OData Clients

Page 4: OData – Super Cola W3

What is OData

• “The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today.”www.odata.org

• “OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores.”

  www.odata.org

Page 5: OData – Super Cola W3

Why use the Open Data Protocol?

• “Provides a uniform way to expose, structure, query and manipulate data using REST practices and JSON or ATOM syntax to describe the payload. OData also provides a uniform way to represent metadata about the data, allowing computers to know more about the type system, relationships and structure of the data.” 

www.odata.org

Page 6: OData – Super Cola W3

www.odata.org

Page 7: OData – Super Cola W3

OData - REST “in Peace”

• URI Conventionshttp://services.odata.org/OData/OData.svc/$metadata

• System Query Optionshttp://services.odata.org/OData/OData.svc/Products?$skip=2&$top=2&$orderby=Rating&$filter=Price le 200 and Price gt 3.5&$select=Price,Name&$inlinecount=allpages&$format=json

http://services.odata.org/OData/OData.svc/GetProductsByRating?rating=5

Page 8: OData – Super Cola W3

URI Conventions usingIE 10 + ChromeLinkPadFiddler

demo

Page 9: OData – Super Cola W3

Writing OData Services using .NET• Web Application / Web Site– Add New Item -> WCF Data Service...

• Create Class derived from DataService– Reflection Provider– Entity Framework Provider

• Configure Entitity/Operation access• Add custom operations• Interceptors

Page 10: OData – Super Cola W3

Writing OData Service using .net- IQueryable- EF (Northwind DB)

demo

Page 11: OData – Super Cola W3

OData Clients: .Net

• Project -> Add Service Reference...

• Security / Authentication [1]

Page 12: OData – Super Cola W3

Consuming OData Service using .net

demo

Page 13: OData – Super Cola W3

OData Clients: Javascript• Javascript– JSON

• V3: Accept: application/json;odata=verbose

• DataJS• JayData• KendoUI

• XSS Issues (JSONP Support!)

Page 14: OData – Super Cola W3

Consumint OData Service using Javascript

demo

Page 15: OData – Super Cola W3

OData Clients: Excel

Page 16: OData – Super Cola W3

OData Clients: LightSwitch

Page 17: OData – Super Cola W3

Useful Tools

• Fiddlerhttp://www.fiddler2.com/fiddler2/

• Tcptracehttp://www.pocketsoap.com/tcptrace/

• LinqPadwww.linqpad.net

Page 18: OData – Super Cola W3

www.odata.org

Page 19: OData – Super Cola W3

Questões?

Page 20: OData – Super Cola W3

Referências• Open Data Protocol (What’s and Why’s)

– http://www.odata.org

• OData - REST “in Peace”– http://www.odata.org/documentation/uri-conventions– http://www.linqpad.net– http://www.fiddler2.com

• Writing/Consuming OData Services– MSDN “Open Data Protocol by Example”

• http://msdn.microsoft.com/en-us/library/ff478141.aspx

– CodeProject “OData Services”• http://www.codeproject.com/Articles/393623/OData-Services

– Authenticating with ADO.NET Data Services • http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/05/27/10447.aspx

Page 21: OData – Super Cola W3

Patrocinador “GOLD”

Twitter: @PTMicrosoft http://www.microsoft.com/portugal

Page 23: OData – Super Cola W3

Patrocinadores “Bronze”

Page 24: OData – Super Cola W3

Questões?

Page 25: OData – Super Cola W3

Próximas reuniões presenciais

• 08/12/2012 – Dezembro (Lisboa)• 26/01/2013 – Janeiro (Lisboa)

23/02/2013 – Fevereiro (Lisboa)16/03/2013 – Março (Lisboa)

Reserva estes dias na agenda! :)


Recommended