Creating REST Services with WCF and EF By
Creating REST Services with WCF and EF By Kevin Israel, MVP – Visual Studio ALM
Creating REST Services with WCF and EF About Me: • Architect with CEI > concentration is ALM practice. • 10 years experience developing with Microsoft Tools and Technologies. • President of the Innsbrook. Net User Group • Richmond Code Camp Planning Committee • Local Regional and National Speaking engagements • Visual Studio ALM MVP
Creating REST Services with WCF and EF
Creating REST Services with WCF and EF What We Will Cover • An overview/discussion of REST as an architectural pattern • Environment Setup • Demo and code discussion – Building a RESTful service with WCF/EF • Practical Usage Pattern • Questions
Creating REST Services with WCF and EF REST as an architectural pattern SOA is all I wanna knowa! REST or nothing!!!!
Creating REST Services with WCF and EF REST as an architectural pattern • REpresentational State Transfer • Pattern given name in a dissertation by Dr. Roy Fielding at the University of California in 2000 • States that web should be less about machine-to-machine interaction (SOA) and more about machine-to-human interaction. • Based on the concept of resources (sources of specific information). Request Resource Client Return Representation Server • We’ve been using REST for years…ever heard of Google? Amazon?
Creating REST Services with WCF and EF REST as an architectural pattern • Uses HTTP/HTTPS transport protocols HTTP CRUD POST Create, Update, Delete GET Read PUT Create, Update DELETE Delete • Different uri patterns – may also present a RESTful uri pattern: http: //mysite/Customer. svc? country=USA http: //mysite/Customer/Country/USA
Creating REST Services with WCF and EF Building WCF REST Services – Environment Setup
Creating REST Services with WCF and EF Building WCF REST Services – Environment Setup
Creating REST Services with WCF and EF
Creating REST Services with WCF and EF DEMO – Code Walkthrough Service Side
Creating REST Services with WCF and EF Key take aways • VS 2010. NET 4. 0 – download WCF template • Not limited to syndication models can use POX, JSON, text, just about anything. • Uses the HTTP transport protocol. • WCF maps Uri to methods • Parameters passed in via query string are auto mapped by WCF to method parameters as long as they are same name. • Can use EF in a layered model.
Creating REST Services with WCF and EF DEMO – Consuming a REST Service
Creating REST Services with WCF and EF Practical Usage Scenarios • REST is a suitable choice for services that exchange data over HTTP and have no requirement to use the advanced protocol capabilities of WCF (SOAP and WS-*) such as: • non-HTTP transports • message exchange patterns other than request/response • message-based security, reliability, and transactions • REST is not suitable for “chatty” messaging. • REST is not suitable for high security scenarios. • REST is not practical for certain B 2 B scenarios.
Creating REST Services with WCF and EF Questions?
Creating REST Services with WCF and EF Contact Information: • Blog – http: //www. vsteamsystemcentral. com/cs 21/blogs/kevin_israel/default. aspx • Email – kevdadev@gmail. com • Site – http: //www. kevinisrael. com • Twitter - @kevdadev
- Slides: 16