SlideShare a Scribd company logo
1 of 23
SOAP vs. REST Putting SOAP to REST Igor MoochnickIgorShare Consulting igor@igorshare.com Blog:  www.igorshare.com/blog
It’s not about one vs. another, but it’s about more tools       in your toolbox
SOAP Call POST http://igorshare.com/weather HTTP/1.1 Content-Type: application/soap+xml Content-Length: 198 <?xml version="1.0"?> <soap:Envelopexmlns:soap=“http://...” soap:encodingStyle="http://..."><soap:Bodyxmlns:m="http://igorshare.com/weather">  <m:GetTemperature>    <m:Zip>02451</m:Zip>  </m:GetTemperature ></soap:Body> </soap:Envelope> REST Call GET http://igorshare.com/weather/?zip=02451 HTTP/1.1 Content-Type: application/json
HTTP Methods
HTTP Methods like CRUD
SOAP Mature tool support Transport Independence Headers are inside the message Send SOAP envelope over SMTP, FTP, MSMQ, JMS, … WS-* WS-Security WS-ReliableMessaging WS-AtomicTransaction WS-BusinessActivity
Why REST Good performance Scalable Easy to build and maintain (simplicity) Easy monitoring Reliable (handling failure, failover, …) Easy to use and test Constraints: Uniform interface Addressable Connectedness Stateless Cacheable
ROA Resource Oriented Architecture Addressability Connectedness (guide from state to state) Stateless Uniform Interface Every resource should be addressable Bookmark Email Link Monitoring Easy to test
REST Simplicity Multiple representations – JSON, CSV, XHTML, XML, etc… Human Readable Results Performance: Scalable architecture Lightweight requests and responses Easier response parsing Bandwidth saving tools (caching, conditional GET, …) Perfect for AJAX clients (using JSON representation)
REST (Advanced) Security SSL – encryption: proven track record (SSL1.0 from 1994) Basic authentication Digest authentication WSSE Username Token Transactions No specific HTTP headers are available Many options are available, can use multiple POST/PUT Think of “shopping cart”
REST (Advanced) Conditional GET  (bandwidth saving tool)
REST (Advanced) Caching Expires:  {date} Cache-Control: {age/no-cache} Look Before You Leap (saves bandwidth) PUT /…/{id} Expect: 100-Continue Result codes: 417 (Expectation Failed) // If service rejects request 100 (Continue)  // If service accepts request
HTTP Success Status Codes
HTTP Redirection Status Codes
HTTP Error Status Codes
HTTP Server Error Status Codes
REST Weaknesses Confusion (high REST vs. low REST) Is it really 4 verbs? (HTTP 1.1. has 8 verbs: HEAD, GET, POST, PUT, DELETE, TRACE, OPTIONS, and CONNECT) Mapping REST-style synchronous semantics on top of back end systems creates design mismatches (when they are based on asynchronous messaging or event driven interaction) Cannot deliver enterprise-style “-ilities” beyond HTTP/SSL Challenging to identify and locate resources appropriately in all applications Apparent lack of standards (other than URI, HTTP, XML, MIME, HTML) Semantics/Syntax description very informal (user/human oriented)
WADL WADL (Web Application Description Language) Not a widely used as WSDL My opinion: overkill Most REST services are self-documented or have a textual description
WADL Example <application xmlns:xsi=“…”>      <grammars>         <include href="ticker.xsd"/>      </grammars>      <resources base="http://www.example.org/services/">         <resource path="getStockQuote">            <method name="GET">                 <request>                    <param name="symbol" style="query“                    type="xsd:string"/>                 </request>                 <response>                    <representation mediaType="application/xml"                         element="ex:quoteResponse"/>                    <fault status="400" ediaType="application/xml"                         element="ex:error"/>                 </response>            </method>          </resource>      </resources> </application>
So what’s RDF? Resource Description Framework Doesn’t require fore-knowledge of type Applies common ontology High discoverability Great framework. Terrible metaphor. Subject/Predicate/Object ?? Entity/Attribute/Value !!
RDF Example <?xml version="1.0"?> <rdf:RDFxmlns:rdf="...” xmlns:cd="..."> <rdf:Descriptionrdf:about="http://www.recshop.fake/cd/Empire Burlesque">   <cd:artist>Bob Dylan</cd:artist>   <cd:country>USA</cd:country>   <cd:company>Columbia</cd:company>   <cd:price>10.90</cd:price>   <cd:year>1985</cd:year> </rdf:Description> <rdf:Descriptionrdf:about="http://www.recshop.fake/cd/Hide your heart">   <cd:artist>Bonnie Tyler</cd:artist>   <cd:country>UK</cd:country>   <cd:company>CBS Records</cd:company>   <cd:price>9.90</cd:price>   <cd:year>1988</cd:year> </rdf:Description> </rdf:RDF>
More Info…. Fiddler Web Proxy Tool (http://fiddler2.com/fiddler2/ ) WCF ReST Starter Kit (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx) PluralSightScreencast – Aaron Skonnard (http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Consuming-REST-services-with-HttpClient/)

More Related Content

Viewers also liked

Dns introduction
Dns   introduction Dns   introduction
Dns introduction
sunil kumar
 
Kanchan Ghangrekar_SrTestingAnalyst
Kanchan Ghangrekar_SrTestingAnalystKanchan Ghangrekar_SrTestingAnalyst
Kanchan Ghangrekar_SrTestingAnalyst
Kanchan Ghangrekar
 
HTTP & HTML & Web
HTTP & HTML & WebHTTP & HTML & Web
HTTP & HTML & Web
Peter R. Egli
 

Viewers also liked (20)

Fundamentos técnicos de internet
Fundamentos técnicos de internetFundamentos técnicos de internet
Fundamentos técnicos de internet
 
Web 2.0 Introduction
Web 2.0 IntroductionWeb 2.0 Introduction
Web 2.0 Introduction
 
DNS & HTTP overview
DNS & HTTP overviewDNS & HTTP overview
DNS & HTTP overview
 
Html,javascript & css
Html,javascript & cssHtml,javascript & css
Html,javascript & css
 
An introduction to Web 2.0: The User Role
An introduction to Web 2.0: The User RoleAn introduction to Web 2.0: The User Role
An introduction to Web 2.0: The User Role
 
Web basics
Web basicsWeb basics
Web basics
 
Introduction to Web 2.0
Introduction to Web 2.0Introduction to Web 2.0
Introduction to Web 2.0
 
Dns introduction
Dns   introduction Dns   introduction
Dns introduction
 
TCP/IP and DNS
TCP/IP and DNSTCP/IP and DNS
TCP/IP and DNS
 
Kanchan Ghangrekar_SrTestingAnalyst
Kanchan Ghangrekar_SrTestingAnalystKanchan Ghangrekar_SrTestingAnalyst
Kanchan Ghangrekar_SrTestingAnalyst
 
TCP/IP Protocols
TCP/IP ProtocolsTCP/IP Protocols
TCP/IP Protocols
 
Software Deployment Principles & Practices
Software Deployment Principles & PracticesSoftware Deployment Principles & Practices
Software Deployment Principles & Practices
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browser
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1
 
HTTP & HTML & Web
HTTP & HTML & WebHTTP & HTML & Web
HTTP & HTML & Web
 
More on Tcp/Ip
More on Tcp/IpMore on Tcp/Ip
More on Tcp/Ip
 
Types of ip address classes
Types of ip address classesTypes of ip address classes
Types of ip address classes
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
 

Similar to Putting SOAP to REST

Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
Lorna Mitchell
 
A simple ReSTful webservice for the Goblins (v. 0.5)
A simple ReSTful webservice for the Goblins (v. 0.5)A simple ReSTful webservice for the Goblins (v. 0.5)
A simple ReSTful webservice for the Goblins (v. 0.5)
Danilo Sanchi
 
Simple Object Access Protocol
Simple Object Access ProtocolSimple Object Access Protocol
Simple Object Access Protocol
Saatviga Sudhahar
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 
Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP
yucefmerhi
 

Similar to Putting SOAP to REST (20)

W3 C Specification For Interoperability And Accessibility For Ajax, Dhtml, Xm...
W3 C Specification For Interoperability And Accessibility For Ajax, Dhtml, Xm...W3 C Specification For Interoperability And Accessibility For Ajax, Dhtml, Xm...
W3 C Specification For Interoperability And Accessibility For Ajax, Dhtml, Xm...
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
 
Web services - REST and SOAP
Web services - REST and SOAPWeb services - REST and SOAP
Web services - REST and SOAP
 
A simple ReSTful webservice for the Goblins (v. 0.5)
A simple ReSTful webservice for the Goblins (v. 0.5)A simple ReSTful webservice for the Goblins (v. 0.5)
A simple ReSTful webservice for the Goblins (v. 0.5)
 
RESTful Web Services and Drupal
RESTful Web Services and DrupalRESTful Web Services and Drupal
RESTful Web Services and Drupal
 
soap
soapsoap
soap
 
XML Training Presentation
XML Training PresentationXML Training Presentation
XML Training Presentation
 
An Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and QueryAn Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and Query
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Simple Object Access Protocol
Simple Object Access ProtocolSimple Object Access Protocol
Simple Object Access Protocol
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Data Applied: Developer Quicklook
Data Applied: Developer QuicklookData Applied: Developer Quicklook
Data Applied: Developer Quicklook
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
 
The Semantic Web An Introduction
The Semantic Web An IntroductionThe Semantic Web An Introduction
The Semantic Web An Introduction
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
 
Real-time Ruby for the Real-time Web
Real-time Ruby for the Real-time WebReal-time Ruby for the Real-time Web
Real-time Ruby for the Real-time Web
 
Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 

More from Igor Moochnick

Tips for building responsive cloud applications
Tips for building responsive cloud applicationsTips for building responsive cloud applications
Tips for building responsive cloud applications
Igor Moochnick
 
Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...
Igor Moochnick
 
Amazon 101 - building composite responsive apps - small
Amazon 101 - building composite responsive apps - smallAmazon 101 - building composite responsive apps - small
Amazon 101 - building composite responsive apps - small
Igor Moochnick
 
Ccr - Concurrency and Coordination Runtime
Ccr - Concurrency and Coordination RuntimeCcr - Concurrency and Coordination Runtime
Ccr - Concurrency and Coordination Runtime
Igor Moochnick
 
NO SQL: What, Why, How
NO SQL: What, Why, HowNO SQL: What, Why, How
NO SQL: What, Why, How
Igor Moochnick
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
Igor Moochnick
 
Best practices for agile design
Best practices for agile designBest practices for agile design
Best practices for agile design
Igor Moochnick
 
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Igor Moochnick
 
Building lean products with distributed agile teams
Building lean products with distributed agile teamsBuilding lean products with distributed agile teams
Building lean products with distributed agile teams
Igor Moochnick
 
Building Gwt Clients For Cloud Apps.Pptx
Building Gwt Clients For Cloud Apps.PptxBuilding Gwt Clients For Cloud Apps.Pptx
Building Gwt Clients For Cloud Apps.Pptx
Igor Moochnick
 

More from Igor Moochnick (20)

Continuous delivery workflow with Docker
Continuous delivery workflow with DockerContinuous delivery workflow with Docker
Continuous delivery workflow with Docker
 
Being a generalist and being great at what you do
Being a generalist and being great at what you doBeing a generalist and being great at what you do
Being a generalist and being great at what you do
 
The journey to container adoption in enterprise
The journey to container adoption in enterpriseThe journey to container adoption in enterprise
The journey to container adoption in enterprise
 
Dev ops overview (brief)
Dev ops overview (brief)Dev ops overview (brief)
Dev ops overview (brief)
 
Dev ops cd tool chains
Dev ops cd tool chainsDev ops cd tool chains
Dev ops cd tool chains
 
Orchestration musings
Orchestration musingsOrchestration musings
Orchestration musings
 
Delivery pipelines
Delivery pipelinesDelivery pipelines
Delivery pipelines
 
Tips for building responsive cloud applications
Tips for building responsive cloud applicationsTips for building responsive cloud applications
Tips for building responsive cloud applications
 
Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...Building complex single page application should be as enjoyable as visit to a...
Building complex single page application should be as enjoyable as visit to a...
 
Amazon 101 - building composite responsive apps - small
Amazon 101 - building composite responsive apps - smallAmazon 101 - building composite responsive apps - small
Amazon 101 - building composite responsive apps - small
 
Ccr - Concurrency and Coordination Runtime
Ccr - Concurrency and Coordination RuntimeCcr - Concurrency and Coordination Runtime
Ccr - Concurrency and Coordination Runtime
 
RavenDB overview
RavenDB overviewRavenDB overview
RavenDB overview
 
NO SQL: What, Why, How
NO SQL: What, Why, HowNO SQL: What, Why, How
NO SQL: What, Why, How
 
Azure ServiceBus Queues and Topics
Azure ServiceBus Queues and TopicsAzure ServiceBus Queues and Topics
Azure ServiceBus Queues and Topics
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
 
Best practices for agile design
Best practices for agile designBest practices for agile design
Best practices for agile design
 
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
 
Building lean products with distributed agile teams
Building lean products with distributed agile teamsBuilding lean products with distributed agile teams
Building lean products with distributed agile teams
 
Practical alm testing
Practical alm   testingPractical alm   testing
Practical alm testing
 
Building Gwt Clients For Cloud Apps.Pptx
Building Gwt Clients For Cloud Apps.PptxBuilding Gwt Clients For Cloud Apps.Pptx
Building Gwt Clients For Cloud Apps.Pptx
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Putting SOAP to REST

  • 1. SOAP vs. REST Putting SOAP to REST Igor MoochnickIgorShare Consulting igor@igorshare.com Blog: www.igorshare.com/blog
  • 2. It’s not about one vs. another, but it’s about more tools in your toolbox
  • 3. SOAP Call POST http://igorshare.com/weather HTTP/1.1 Content-Type: application/soap+xml Content-Length: 198 <?xml version="1.0"?> <soap:Envelopexmlns:soap=“http://...” soap:encodingStyle="http://..."><soap:Bodyxmlns:m="http://igorshare.com/weather">  <m:GetTemperature>    <m:Zip>02451</m:Zip>  </m:GetTemperature ></soap:Body> </soap:Envelope> REST Call GET http://igorshare.com/weather/?zip=02451 HTTP/1.1 Content-Type: application/json
  • 6. SOAP Mature tool support Transport Independence Headers are inside the message Send SOAP envelope over SMTP, FTP, MSMQ, JMS, … WS-* WS-Security WS-ReliableMessaging WS-AtomicTransaction WS-BusinessActivity
  • 7. Why REST Good performance Scalable Easy to build and maintain (simplicity) Easy monitoring Reliable (handling failure, failover, …) Easy to use and test Constraints: Uniform interface Addressable Connectedness Stateless Cacheable
  • 8. ROA Resource Oriented Architecture Addressability Connectedness (guide from state to state) Stateless Uniform Interface Every resource should be addressable Bookmark Email Link Monitoring Easy to test
  • 9. REST Simplicity Multiple representations – JSON, CSV, XHTML, XML, etc… Human Readable Results Performance: Scalable architecture Lightweight requests and responses Easier response parsing Bandwidth saving tools (caching, conditional GET, …) Perfect for AJAX clients (using JSON representation)
  • 10. REST (Advanced) Security SSL – encryption: proven track record (SSL1.0 from 1994) Basic authentication Digest authentication WSSE Username Token Transactions No specific HTTP headers are available Many options are available, can use multiple POST/PUT Think of “shopping cart”
  • 11. REST (Advanced) Conditional GET (bandwidth saving tool)
  • 12. REST (Advanced) Caching Expires: {date} Cache-Control: {age/no-cache} Look Before You Leap (saves bandwidth) PUT /…/{id} Expect: 100-Continue Result codes: 417 (Expectation Failed) // If service rejects request 100 (Continue) // If service accepts request
  • 16. HTTP Server Error Status Codes
  • 17.
  • 18. REST Weaknesses Confusion (high REST vs. low REST) Is it really 4 verbs? (HTTP 1.1. has 8 verbs: HEAD, GET, POST, PUT, DELETE, TRACE, OPTIONS, and CONNECT) Mapping REST-style synchronous semantics on top of back end systems creates design mismatches (when they are based on asynchronous messaging or event driven interaction) Cannot deliver enterprise-style “-ilities” beyond HTTP/SSL Challenging to identify and locate resources appropriately in all applications Apparent lack of standards (other than URI, HTTP, XML, MIME, HTML) Semantics/Syntax description very informal (user/human oriented)
  • 19. WADL WADL (Web Application Description Language) Not a widely used as WSDL My opinion: overkill Most REST services are self-documented or have a textual description
  • 20. WADL Example <application xmlns:xsi=“…”> <grammars> <include href="ticker.xsd"/> </grammars> <resources base="http://www.example.org/services/"> <resource path="getStockQuote"> <method name="GET"> <request> <param name="symbol" style="query“ type="xsd:string"/> </request> <response> <representation mediaType="application/xml" element="ex:quoteResponse"/> <fault status="400" ediaType="application/xml" element="ex:error"/> </response> </method> </resource> </resources> </application>
  • 21. So what’s RDF? Resource Description Framework Doesn’t require fore-knowledge of type Applies common ontology High discoverability Great framework. Terrible metaphor. Subject/Predicate/Object ?? Entity/Attribute/Value !!
  • 22. RDF Example <?xml version="1.0"?> <rdf:RDFxmlns:rdf="...” xmlns:cd="..."> <rdf:Descriptionrdf:about="http://www.recshop.fake/cd/Empire Burlesque"> <cd:artist>Bob Dylan</cd:artist> <cd:country>USA</cd:country> <cd:company>Columbia</cd:company> <cd:price>10.90</cd:price> <cd:year>1985</cd:year> </rdf:Description> <rdf:Descriptionrdf:about="http://www.recshop.fake/cd/Hide your heart"> <cd:artist>Bonnie Tyler</cd:artist> <cd:country>UK</cd:country> <cd:company>CBS Records</cd:company> <cd:price>9.90</cd:price> <cd:year>1988</cd:year> </rdf:Description> </rdf:RDF>
  • 23. More Info…. Fiddler Web Proxy Tool (http://fiddler2.com/fiddler2/ ) WCF ReST Starter Kit (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx) PluralSightScreencast – Aaron Skonnard (http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Consuming-REST-services-with-HttpClient/)