Best Practices: Creating OData Services using WCF Data Services Tech Ed North America 2010 12/6/2018 9:28 PM Required Slide SESSION CODE: DEV323 Best Practices: Creating OData Services using WCF Data Services Alex James Program Manager Microsoft Corporation alexj@microsoft.com twitter.com/adjames blogs.msdn.com/alexj © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Do you know… How to lock down your service? How to allow generic clients to connect? How to authenticate users of your service? How to authorize users? How to version you service?
Why does this matter? You should only allow what you intend You want to have as much reach as possible No one wants to create a new Identity You can’t disclose too much information Versioning is inevitable
Building a basic OData Service Tech Ed North America 2010 12/6/2018 9:28 PM Building a basic OData Service Alex James Program Manager Microsoft DEMO © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Next steps – Lock it down EntitySet Access Configuration Server Driven Paging Authorization
Tech Ed North America 2010 Alex James Program Manager Microsoft 12/6/2018 9:28 PM Locking it down Alex James Program Manager Microsoft DEMO © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Increase the Reach Make our feeds Browser friendly Allow cross site access from: Silverlight Javascript Re-use identities Forms Authentication Claims Based Authentication Support multiple versions
Tech Ed North America 2010 Alex James Program Manager Microsoft 12/6/2018 9:28 PM Increase your reach Alex James Program Manager Microsoft DEMO © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
JSONP - Concepts <script> ajax callback({“x”=1}) {“x”=1} Site 1
Grant “Printing Service” Access to you Photos? Resource Owner 5) Redirect user to Return URL 3) Redirect Resource Owner to Auth URL Printing Service Return URL 1) ask for a request token + return URL 2) Request token + auth URL 7) Access Token Grant “Printing Service” Access to you Photos? user 6) Try to use Request Token to acquire Access Token password Photo Service Ok Ok Protected Resources 4) Check for authenticated user consent 8) GET protected resources + Access Token
Versioning With DataServiceContext.IgnoreMissingProperties: You can safely Add a new optional property Remove a property – Read Only Add unrelated new types But lots of things can go wrong. Add a required property or navigation Remove a property – Read/Write Rename a property (fail). Remove a type / feed Realistic Solution V1/service.svc/ V2/service.svc/
Recap You just learned how to: Expose just what you want Authenticate users of your service Authorize users Increase the reach of you service You know how to create a REAL service…
Create an OData Service Today! Its easy ! You know how to do it right Tell us about it and we will tell the world: www.odata.org/producers
Aaron Skonnard: Fabrice Marguerie: “Having our On-Demand courses pointed to by OData.org has really helped increase the awareness around our offerings over the past few months.” Fabrice Marguerie: “early producers will be referenced in Sesame Data Browser's connection dialog...”
Presentation Resources Music Store App - http://mvcmusicstore.codeplex.com/ OData Explorer - http://www.silverlight.net/content/samples/odataexplorer/ JSONP - http://code.msdn.microsoft.com/DataServicesJSONP Contact Me: Twitter: http://twitter.com/adjames Blog: http://blogs.msdn.com/alexj Email: alex.james@microsoft.com
Additional Resources and Announcements MSDN Data Developer Center: http://msdn.com/data ADO.NET Team Blog: http://blogs.msdn.com/adonet OData Blog: http://odata.org/blog WCF Data Services Team Blog: http://blogs.msdn.com/astoriateam EF Design Blog: http://blogs.msdn.com/efdesign Data Platform Development Forums: http://msdn.com/data and click on the “Forums” tab Come to the Data Development station in the DAT Track Area (yellow section of the TLC) to register for a Zune HD give-away!
Related Content Required Slide Speakers, please list the Breakout Sessions, Interactive Sessions, Labs and Demo Stations that are related to your session. Tech Ed North America 2010 12/6/2018 9:28 PM Related Content DEV324: Data Development GPS: Guidance for Choosing the Right Data Access Technology – Monday | 1:00 – 2:15 PM | Rm 383 DEV208: Open Data for the Open Web – Tuesday | 5:00 – 6:15 PM | Rm 279 DEV205: Overview of the Microsoft ADO.NET Entity Framework – Wednesday | 1:30 – 2:45 PM | Auditorium B DEV303: Building RESTful Applications with the Open Data Protocol – Wednesday | 3:15 – 4:30 PM | Rm 283 ARC306: Open Data for the Enterprise – Thursday | 8:00 – 9:15 AM | Rm 288 DEV305: Deep Dive into Microsoft ADO.NET Entity Framework – Thursday | 1:30 – 2:45 PM | Auditorium A BOF05-DV: Microsoft ADO.NET Entity Framework 4.0: What’s Your Take? – Thursday | 9:45-11:00 AM DEV13-HOL: Building Applications and Services Using Open Data Protocol DEV11-HOL: Using the Entity Framework in Microsoft .NET Framework 4.0 and Microsoft Visual Studio 2010 TLC-77: Microsoft SQL Server R2 Data Development (ADO.NET, OData, XML) – TLC Yellow © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Tech Ed North America 2010 12/6/2018 9:28 PM Track Resources Visual Studio – http://www.microsoft.com/visualstudio/en-us/ Soma’s Blog – http://blogs.msdn.com/b/somasegar/ MSDN Data Developer Center – http://msdn.com/data ADO.NET Team Blog – http://blogs.msdn.com/adonet WCF Data Services Team Blog – http://blogs.msdn.com/astoriateam EF Design Blog – http://blogs.msdn.com/efdesign © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Resources Learning Required Slide www.microsoft.com/teched Tech Ed North America 2010 12/6/2018 9:28 PM Required Slide Resources Learning Sessions On-Demand & Community Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning Resources for IT Professionals Resources for Developers http://microsoft.com/technet http://microsoft.com/msdn © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Complete an evaluation on CommNet and enter to win! Tech Ed North America 2010 12/6/2018 9:28 PM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year
Tech Ed North America 2010 12/6/2018 9:28 PM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Required Slide Tech Ed North America 2010 12/6/2018 9:28 PM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.