SlideShare uma empresa Scribd logo
1 de 32
Doing REST with new WCF Web API  Himanshu Desai Senior Consultant - Readify Discover. Master. Influence.
Agenda Web as Resource Oriented Architecture ,[object Object],Overview of REST What is REST?  REST Constraints REST Benefits REST using WCF REST Support in WCF WCF Web API  Discover. Master. Influence.
Resource Oriented Architecture 3 Discover. Master. Influence.
Current Industry Trends A Move to cloud-based computing A Migration away from SOAP More browser based Apps Adoption of REST Other standards like OAuth, WebSockets Discover. Master. Influence. 4
What is REST?  Representational State Transfer Idea floated by Roy Fielding Architecture Style (not a protocol or spec and it is not restricted to HTTP) Discover. Master. Influence. 5
REST Constraints Client - server Stateless Cacheable Layered Uniform interface Discover. Master. Influence. 6
REST Constraints Uniform interface Client - server Stateless Cacheable Layered Discover. Master. Influence. 7
REST Benefits Scalability of component interactions Evolvability Reach Intermediary components to reduce latency, enforce security and encapsulate legacy systems Discover. Master. Influence. 8
RESTful Services-1 A Traditional RPC based Service Moving from Verb to Noun Users Bookmarks Discover. Master. Influence. 9
RESTful Services-2 Designing the Uri Template An invidual user account An individual bookmark A user’s collection of private/public bookmark Collection of all public bookmarks Applying the Uniform HTTP Interface Discover. Master. Influence. 10
RESTful Services-2 11 Discover. Master. Influence.
RESTful Services-3 Designing Resource Representation Discover. Master. Influence. 12
RESTful Services-4 Designing Resource Representation <User> 	< Email>aaron@pluralsight.com</Email> 	<Name>Aaron Skonnard</Name> </User> Supporting Alternate Representation ?tag={tag}&format=json {username}?tag={tag}&format=json users/{username}?format=json users/{username}/profile?format=json Security Consideration Providing Resource Metadata Avoiding RPC Tendencies 13 Discover. Master. Influence.
GET Example REQUEST GET /index.html Host: www.example.com RESPONSE HTTP/1.1 200 OK Etag: „3f80f-1b6-3e1cb03b” Content-Type: text/html; charset=UTF-8 l Discover. Master. Influence. 14
POST Example POST /order HTTP/1.1 Host: amazon.net Content-Type: application/xml Content-Length: 216 <order xmlns="http://schemas.amazon.net/order"> <drink>latte</drink> </order> 201 Created Location: http://amazon.net/order/1234 ContentType: application/xml <order xmlns="http://schemas.amazon.net/order"> ... l Discover. Master. Influence. 15
PUT Example PUT /payment/1234 HTTP/1.1 Host: amazon.net Content-Type: application/xml Content-Length: 216 <payment xmlns="http://schemas.amazon.net/order"> <cardNumber>...</cardNumber> </order> 200 OK ContentType: application/vnd.amazon+xmlxmlns="http://schemas.amazon.net/order"> <drink>Latte</drink> <link href=„payment/1234” rel=„http://relations.amazon.net/payment”/> </order> l Discover. Master. Influence. 16
Central Principle Existence of resource which is referenced with a global identifier (e.g. a image, document etc.) Communicate via a standard interface (e.g. HTTP) Exchange representations of these resources (HTML.XML,JSON etc.) Discover. Master. Influence. 17
RESTful web services Collection of data  Base URI e.g. http://ebay.com/items/1 Internet Media type of the data supported by the web service. (JSON,XML etc.) Set of operation supported by the web service using HTTP methods (POST,GET,PUT or DELETE) Discover. Master. Influence. 18
REST Using WCF Discover. Master. Influence.
Rest Support Comparison Discover. Master. Influence. 20
WCF Web API HTTP is now a first class  Content negotiation Automatic help pages Service Routes Integration with ASP.NET Caching Reach any client     (Browser, Devices, Silverlight, Desktop) Discover. Master. Influence. 21
Resource Architecture Op Handler2 Transport+Encoder Message Handler 1  Response Discover. Master. Influence. 22 Dispatcher GetById? GetById? Op Handler 3 Op Handler 4 Op Handler 1 Message Handler 2 Request
Components Content Negotiation Central Configuration (Fluent API) Http  Classes Operation Handler Factory Error Handler Message Handler Factory(Channel Level) Discover. Master. Influence. 23
Classes for Request & Response ,[object Object]
HttpResponseMessage
HttpContent
HttpClientDiscover. Master. Influence. 24
Content Negotiation Support for Multiple Formats including an add-in model if you want xml ,it gives xml and if you want Json, it gives Json Discover. Master. Influence. 25
Demo Content Negotiation Discover. Master. Influence.
Operation Handler Factory Responsible for creating new instances of Media Type Formatters and Operation Handlers. Media Type Formatter  Operation Handler - an abstract base class used to create transfer a set of input into a set of output Discover. Master. Influence. 27
Operation Handler Factory Request Pipeline Response Pipeline Operation Handler Operation Handler Operation Handler Operation Handler Operation Handler Operation Handler Dispatch Discover. Master. Influence. 28
Message Handler Factory Operation Message Handler4 Message Handler3 Message Handler 1 Message Handler2 Discover. Master. Influence. 29

Mais conteúdo relacionado

Mais procurados

REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Security Patterns with WSO2 ESB
Security Patterns with WSO2 ESBSecurity Patterns with WSO2 ESB
Security Patterns with WSO2 ESB
WSO2
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
Bhavendra Chavan
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
Jorgen Thelin
 
Web Service
Web ServiceWeb Service
Web Service
Eri Alam
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
Doris Chen
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
george.james
 

Mais procurados (20)

Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCF
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
WCF And ASMX Web Services
WCF And ASMX Web ServicesWCF And ASMX Web Services
WCF And ASMX Web Services
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Security Patterns with WSO2 ESB
Security Patterns with WSO2 ESBSecurity Patterns with WSO2 ESB
Security Patterns with WSO2 ESB
 
Rest vs Soap
Rest vs SoapRest vs Soap
Rest vs Soap
 
Apache CXF - New Features
Apache CXF - New FeaturesApache CXF - New Features
Apache CXF - New Features
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
 
CXF 3.0, What's new?
CXF 3.0, What's new?CXF 3.0, What's new?
CXF 3.0, What's new?
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 
Web Service
Web ServiceWeb Service
Web Service
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
 
Apache CXF New Directions in Integration
Apache CXF New Directions in IntegrationApache CXF New Directions in Integration
Apache CXF New Directions in Integration
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
 
The experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare networkThe experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare network
 

Semelhante a Wcf rest api introduction

Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservice
lonegunman
 
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
rahmed_sct
 

Semelhante a Wcf rest api introduction (20)

Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservice
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 
sMash_for_zOS-users
sMash_for_zOS-userssMash_for_zOS-users
sMash_for_zOS-users
 
Library Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific InformationLibrary Web Services for Discovery and Delivery of Scientific Information
Library Web Services for Discovery and Delivery of Scientific Information
 
.Net3.5 Overview
.Net3.5 Overview.Net3.5 Overview
.Net3.5 Overview
 
Why do you need REST
Why do you need RESTWhy do you need REST
Why do you need REST
 
What's New in Confluent Platform 5.5
What's New in Confluent Platform 5.5What's New in Confluent Platform 5.5
What's New in Confluent Platform 5.5
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
 
Marata
MarataMarata
Marata
 
Net35 Overview
Net35 OverviewNet35 Overview
Net35 Overview
 
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
 
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedWinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
 
GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
RESTful WCF Services
RESTful WCF ServicesRESTful WCF Services
RESTful WCF Services
 

Mais de Himanshu Desai

Multitenancy Options on Azure
Multitenancy Options on AzureMultitenancy Options on Azure
Multitenancy Options on Azure
Himanshu Desai
 

Mais de Himanshu Desai (12)

Service fabric overview
Service fabric overviewService fabric overview
Service fabric overview
 
App insights and testhub
App insights and testhubApp insights and testhub
App insights and testhub
 
Devops
Devops Devops
Devops
 
Cross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team ServicesCross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team Services
 
Visual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management OverviewVisual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management Overview
 
Visual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewVisual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services Overview
 
Multitenancy Options on Azure
Multitenancy Options on AzureMultitenancy Options on Azure
Multitenancy Options on Azure
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
 
How to Improve agile team efficiency
How to Improve agile team efficiencyHow to Improve agile team efficiency
How to Improve agile team efficiency
 
Storage Options on Windows Azure
Storage Options on Windows AzureStorage Options on Windows Azure
Storage Options on Windows Azure
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performance
 
ASP.NET Web API O to 100
ASP.NET Web API O to 100ASP.NET Web API O to 100
ASP.NET Web API O to 100
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Wcf rest api introduction

  • 1. Doing REST with new WCF Web API Himanshu Desai Senior Consultant - Readify Discover. Master. Influence.
  • 2.
  • 3. Resource Oriented Architecture 3 Discover. Master. Influence.
  • 4. Current Industry Trends A Move to cloud-based computing A Migration away from SOAP More browser based Apps Adoption of REST Other standards like OAuth, WebSockets Discover. Master. Influence. 4
  • 5. What is REST? Representational State Transfer Idea floated by Roy Fielding Architecture Style (not a protocol or spec and it is not restricted to HTTP) Discover. Master. Influence. 5
  • 6. REST Constraints Client - server Stateless Cacheable Layered Uniform interface Discover. Master. Influence. 6
  • 7. REST Constraints Uniform interface Client - server Stateless Cacheable Layered Discover. Master. Influence. 7
  • 8. REST Benefits Scalability of component interactions Evolvability Reach Intermediary components to reduce latency, enforce security and encapsulate legacy systems Discover. Master. Influence. 8
  • 9. RESTful Services-1 A Traditional RPC based Service Moving from Verb to Noun Users Bookmarks Discover. Master. Influence. 9
  • 10. RESTful Services-2 Designing the Uri Template An invidual user account An individual bookmark A user’s collection of private/public bookmark Collection of all public bookmarks Applying the Uniform HTTP Interface Discover. Master. Influence. 10
  • 11. RESTful Services-2 11 Discover. Master. Influence.
  • 12. RESTful Services-3 Designing Resource Representation Discover. Master. Influence. 12
  • 13. RESTful Services-4 Designing Resource Representation <User> < Email>aaron@pluralsight.com</Email> <Name>Aaron Skonnard</Name> </User> Supporting Alternate Representation ?tag={tag}&format=json {username}?tag={tag}&format=json users/{username}?format=json users/{username}/profile?format=json Security Consideration Providing Resource Metadata Avoiding RPC Tendencies 13 Discover. Master. Influence.
  • 14. GET Example REQUEST GET /index.html Host: www.example.com RESPONSE HTTP/1.1 200 OK Etag: „3f80f-1b6-3e1cb03b” Content-Type: text/html; charset=UTF-8 l Discover. Master. Influence. 14
  • 15. POST Example POST /order HTTP/1.1 Host: amazon.net Content-Type: application/xml Content-Length: 216 <order xmlns="http://schemas.amazon.net/order"> <drink>latte</drink> </order> 201 Created Location: http://amazon.net/order/1234 ContentType: application/xml <order xmlns="http://schemas.amazon.net/order"> ... l Discover. Master. Influence. 15
  • 16. PUT Example PUT /payment/1234 HTTP/1.1 Host: amazon.net Content-Type: application/xml Content-Length: 216 <payment xmlns="http://schemas.amazon.net/order"> <cardNumber>...</cardNumber> </order> 200 OK ContentType: application/vnd.amazon+xmlxmlns="http://schemas.amazon.net/order"> <drink>Latte</drink> <link href=„payment/1234” rel=„http://relations.amazon.net/payment”/> </order> l Discover. Master. Influence. 16
  • 17. Central Principle Existence of resource which is referenced with a global identifier (e.g. a image, document etc.) Communicate via a standard interface (e.g. HTTP) Exchange representations of these resources (HTML.XML,JSON etc.) Discover. Master. Influence. 17
  • 18. RESTful web services Collection of data Base URI e.g. http://ebay.com/items/1 Internet Media type of the data supported by the web service. (JSON,XML etc.) Set of operation supported by the web service using HTTP methods (POST,GET,PUT or DELETE) Discover. Master. Influence. 18
  • 19. REST Using WCF Discover. Master. Influence.
  • 20. Rest Support Comparison Discover. Master. Influence. 20
  • 21. WCF Web API HTTP is now a first class Content negotiation Automatic help pages Service Routes Integration with ASP.NET Caching Reach any client (Browser, Devices, Silverlight, Desktop) Discover. Master. Influence. 21
  • 22. Resource Architecture Op Handler2 Transport+Encoder Message Handler 1 Response Discover. Master. Influence. 22 Dispatcher GetById? GetById? Op Handler 3 Op Handler 4 Op Handler 1 Message Handler 2 Request
  • 23. Components Content Negotiation Central Configuration (Fluent API) Http Classes Operation Handler Factory Error Handler Message Handler Factory(Channel Level) Discover. Master. Influence. 23
  • 24.
  • 28. Content Negotiation Support for Multiple Formats including an add-in model if you want xml ,it gives xml and if you want Json, it gives Json Discover. Master. Influence. 25
  • 29. Demo Content Negotiation Discover. Master. Influence.
  • 30. Operation Handler Factory Responsible for creating new instances of Media Type Formatters and Operation Handlers. Media Type Formatter Operation Handler - an abstract base class used to create transfer a set of input into a set of output Discover. Master. Influence. 27
  • 31. Operation Handler Factory Request Pipeline Response Pipeline Operation Handler Operation Handler Operation Handler Operation Handler Operation Handler Operation Handler Dispatch Discover. Master. Influence. 28
  • 32. Message Handler Factory Operation Message Handler4 Message Handler3 Message Handler 1 Message Handler2 Discover. Master. Influence. 29
  • 33. Query Composition Support for OData like query support http://localhost/AlbumService/albums?$Top=5 http://localhost/AlbumService/albums?$Top=5&$OrderBy=Title Discover. Master. Influence. 30
  • 34. Consuming RESTful Services Consuming with Javascript Consuming with WCF 31 Discover. Master. Influence.
  • 35. Consuming Web API with Javascript 32 Discover. Master. Influence.
  • 36. HttpClient Helps you access web resources using Linq var client = new HttpClient(address); var personQuery = client.CreateQuery<Person>(); var results = personQuery.ExecuteAsync().ContinueWith(p => { //Dosomething here }); Discover. Master. Influence. 33
  • 37. Demo Query Composition & HttpClient Discover. Master. Influence.

Notas do Editor

  1. http://msdn.microsoft.com/en-us/library/dd203052.aspx
  2. Representational State TransferIdea floated by Roy FieldingArchitectural Style (not a protocol or spec and it is not restricted to HTTP)ConceptREST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources. A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.At any particular time, a client can either be in transition between application states or &quot;at rest&quot;. A client in a rest state is able to interact with its user, but creates no load and consumes no per-client storage on the servers or on the network.The client begins sending requests when it is ready to make the transition to a new state. While one or more requests are outstanding, the client is considered to be in transition. The representation of each application state contains links that may be used next time the client chooses to initiate a new state transition.REST was initially described in the context of HTTP, but is not limited to that protocol. RESTful architectures can be based on other Application Layer protocols if they already provide a rich and uniform vocabulary for applications based on the transfer of meaningful representational state. RESTful applications maximize the use of the pre-existing, well-defined interface and other built-in capabilities provided by the chosen network protocol, and minimize the addition of new application-specific features on top of it.
  3. Evolvability In a RESTful system the entire infrastructure- including intermediaries such as load-balancers, caches, proxies etc. becomes participants in the communication.
  4. Evolvability In a RESTful system the entire infrastructure- including intermediaries such as load-balancers, caches, proxies etc. becomes participants in the communication.
  5. Evolvability In a RESTful system the entire infrastructure- including intermediaries such as load-balancers, caches, proxies etc. becomes participants in the communication.
  6. Evolvability In a RESTful system the entire infrastructure- including intermediaries such as load-balancers, caches, proxies etc. becomes participants in the communication.
  7. In 3.5 &amp; 4.0New Attributes (WebGet/WebInvoke)New Binding (WebHttpBinding)Routing, help pages etc.Partial Support for Content negotiationIn .NET 4, Out of box XML and Json were supported. If you need to support other types , you need to extent webcontenttypemapper.Service routes- provides compile time checking. Integrates with ASP.NET RoutingYou host service which is then available as a route.WCF Web APIHTTP is now a first class Content negotiationAutomatic help pagesService RoutesIntegration with ASP.NET CachingReach any client (Browser, Devices, Silverlight, Desktop)
  8. Service routes- provides compile time checking. Integrates with ASP.NET RoutingYou host service which is then available as a route.