SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Web Services
An Introduction
Monday, September 23, 13
Web Services
What Do They Do?
How Do They Work?
Wrap-Up
HTTP
Payload
Headers
Flavors
Discovery
ToolsReferences
Questions
Monday, September 23, 13
What Do They Do?
• What don’t they do?
• Heavily used technology
• Everyone knows the Web
• Lots of developers create for the Web
Monday, September 23, 13
Out in the World
• Most Web applications use Web Services
• Many mobile apps use them
• Many desktop applications use them
• Even some command-line programs do
Monday, September 23, 13
How Do They Work?
• A suite of standard technologies:
• HTTP
• URL
• JSON, XML, YAML, etc.
• DNS
Monday, September 23, 13
HTTP
• Request
• URL
• Method
• Headers
• Payload
• Response
• Status Code
• Headers
• Payload
• HTTP is stateless!
Monday, September 23, 13
URL
https://mypropaq.zoll.local:443/Loc/Res?Qry#Frag
Protocol
Subdomain
Domain
Top-Level
Domain
Port
“Location”
Resource
Query
Fragment
Most Components are Optional
Monday, September 23, 13
HTTP Methods
• Most Common
•GET
•POST
•PUT
•DELETE
• Less Used
•HEAD
•OPTIONS
•CONNECT
•TRACE
•PATCH
Monday, September 23, 13
HTTP Status Codes
• All 3 digit numbers
• 1xx: Informational
• 2xx: Success
• 3xx: Redirection
• 4xx: Your Fault
• 5xx: Our Fault
Monday, September 23, 13
HTTP Headers
• A set of key-value pairs
• There is an official set of keys
• Convention enforces the correct use of keys
• Handles authentication, caching, checksums,
chunking, compression, cookies, formats, and
sessions
Monday, September 23, 13
Payload
• Can be anything needed, of any size
• Can be compressed
• Can have an MD5 checksum applied to it
• Can be chunked into multiple pieces for easier
consumption
Monday, September 23, 13
Payload Formats
• A handful of textual formats are popular:
• CSV, INI, JSON, RDF, TSV, TXT, XML, YAML
• For data: CSV, RDF, TSV, TXT, & XML are popular
• For configuration: INI, JSON, & YAML are popular
• For documents: JSON, TXT, & XML are popular
• For communications: JSON is most popular
Monday, September 23, 13
Why JSON?
[Test]
DC.Title = Test Data File
DC.Description = Simple test to compare INI, JSON, XML, and YAML.
DC.Creator = Eric W. Brown
DC.Identifier = 1
DC.Subject[1] = Test
DC.Subject[2] = INI
DC.Subject[3] = JSON
DC.Subject[4] = XML
DC.Subject[5] = YAML
DC.Subject[6] = Text
DC.Type = Dataset
DC.Coverage = Basic comparison of textual formats
DC.Contributors[1] = Eric W. Brown
DC.Language = en-US
DC.Date = 2013/09/13 08:19:14.764159 GMT-4
DC.Rights = All Rights Reserved
DC.Publisher = ZOLL
Version = 1.0
INI {
"DC.Title": "Test Data File",
"DC.Description": "Simple test to compare INI, JSON, XML, and YAML.",
"DC.Creator": "Eric W. Brown",
"DC.Identifier": 1,
"DC.Subject": ["Test", "INI", "JSON", "XML", "YAML", "Text"],
"DC.Type": "Dataset",
"DC.Coverage": "Basic comparison of textual formats",
"DC.Contributors": ["Eric W. Brown"],
"DC.Language": "en-US",
"DC.Date": "2013/09/13 08:19:14.764159 GMT-4",
"DC.Rights": "All Rights Reserved",
"DC.Publisher": "ZOLL",
"Version": 1.0
}
JSON
<?xml version="1.0" encoding="UTF-8" ?>
<test xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<dc:title>Test Data File</dc:title>
<dc:description>
Simple test to compare INI, JSON, XML, and YAML.
</dc:description>
<dc:creator>Eric W. Brown</dc:creator>
<dc:identifier>1</dc:identifier>
<subject>
<dc:subject>Test</dc:subject>
<dc:subject>INI</dc:subject>
<dc:subject>JSON</dc:subject>
<dc:subject>XML</dc:subject>
<dc:subject>YAML</dc:subject>
<dc:subject>Text</dc:subject>
</subject>
<dc:type>Dataset</dc:type>
<dc:coverage>Basic comparison of textual formats</dc:coverage>
<contributors>
<dc:contributor>Eric W. Brown</dc:contributor>
</contributors>
<dc:language>en-US</dc:language>
<dc:date>2013/09/13 08:19:14.764159 GMT-4</dc:date>
<dc:rights>All Rights Reserved</dc:rights>
<dc:publisher>ZOLL</dc:publisher>
<version>1.0</version>
</test>
XML
DC:
Title: Test Data File
Description: Simple test to compare INI, JSON, XML, and YAML.
Creator: Eric W. Brown
Identifier: 1
Subject:
- Test
- INI
- JSON
- XML
- YAML
- Text
Type: Dataset
Coverage: Basic comparison of textual formats
Contributors:
- Eric W. Brown
Language: en-US
Date: 2013/09/13 08:19:14.764159 GMT-4
Rights: All Rights Reserved
Publisher: ZOLL
Version: 1.0
YAML
Monday, September 23, 13
Read - Parse - Write & Size Comparisons
(naïve & unscientific)
% ./testINI.py
10.1204838753
% ./testJSON.py
8.89217090607
% ./testXML.py
9.28052902222
% ./testYAML.py
9.27972102165
% wc -c test.*
500 test.ini
333 test.ini.gz
490 test.json
337 test.json.gz
889 test.xml
462 test.xml.gz
627 test.yaml
331 test.yaml.gz
3969 total
Monday, September 23, 13
Flavors
• A handful of popular options:
• SOAP
• XML-RPC
• JSON-RPC
• REST
• REST is quickly becoming the most popular
Monday, September 23, 13
Why REST?
Request:
POST /GetEvent HTTP/1.1
Host: www.example.org
Date: Wed, 31 Aug 2011 12:23:00 GMT
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 413
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:ev="http://www.example.org/events">
<soap:Header>
</soap:Header>
<soap:Body>
<ev:GetEvent xmlns:ev="http://www.example.org/GetEvent">
<ev:EventNumber>23</ev:EventNumber>
</ev:GetEvent>
</soap:Body>
</soap:Envelope>
Response:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:05 GMT
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 493
Server: Spiffy SOAP Server
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:ev="http://www.example.org/events">
<soap:Header>
<ev:Date>2011-09-31T12:23:05-00:00</ev:Date>
</soap:Header>
<soap:Body>
<ev:Event>
<ev:Name>Saugus.net Ghost Story Contest Deadline</ev:Name>
<ev:Date>October 22, 2011</ev:Date>
<ev:Time>11:59:59 PM</ev:Time>
</ev:Event>
</soap:Body>
</soap:Envelope>
Fault:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:05 GMT
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 536
SOAPRequest:
POST /GetEvent HTTP/1.1
Host: www.example.org
Date: Wed, 31 Aug 2011 12:23:00 GMT
Content-Type: application/xml; charset=utf-8
Content-Length: 177
<?xml version="1.0"?>
<methodCall>
<methodName>example.getEvent</methodName>
<params>
<param>
<value><int>23</int></value>
</param>
</params>
</methodCall>
Response:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:02 GMT
Content-Type: application/xml; charset=utf-8
Content-Length: 531
Server: Spiffy XMLRPC Server
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<struct>
<member>
<name>Name</name>
<value><string>Saugus.net Ghost Story
Contest Deadline</string></value>
</member>
<member>
<name>Date</name>
<value><string>October 22, 2011</string></value>
</member>
<member>
<name>Time</name>
<value><string>11:59:59 PM</string></value>
</member>
</struct>
</param>
</params>
</methodResponse>
Fault:
HTTP/1.0 200 OK
XML-RPC
Request:
POST /events HTTP/1.1
Host: www.example.org
Date: Wed, 31 Aug 2011 12:23:00 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 50
{
"method":"GetEvent",
"params":[23],
"id":1
}
Response:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:02 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 158
Server: Spiffy JSONRPC Server
{
"result":{
"Name":"Saugus.net Ghost Story Contest Deadline",
"Date":"October 22, 2011",
"Time":"11:59:59 PM"
},
"error":null,
"id":1
}
Fault:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:02 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 93
Server: Spiffy JSONRPC Server
{
"result":null,
"error":{
"fault":5,
"reason":"No such event."
},
"id":1
}
JSON-RPC
Request:
GET /GetEvent/23 HTTP/1.1
Host: www.example.org
Date: Wed, 31 Aug 2011 12:23:00 GMT
Accept: application/json
Response:
HTTP/1.0 200 OK
Date: Wed, 31 Aug 2011 12:23:01 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 108
Last-Modified: Tue, 30 Aug 2011 1:00:00 GMT
Server: Spiffy REST Server
{
"Name":"Saugus.net Ghost Story Contest Deadline",
"Date":"October 22, 2011",
"Time":"11:59:59 PM"
}
Fault:
HTTP/1.0 404 NOTFOUND
Date: Wed, 31 Aug 2011 12:23:01 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 46
Server: Spiffy REST Server
{
"fault":5,
"reason":"No such event."
}
REST
Keeps Going! Keeps Going!
Monday, September 23, 13
Streaming
• Chunking is good for large uploads or downloads
• Not sufficient for two-way communications
• Request / Response cycle has a lot of overhead
• WebSockets solve this problem
Monday, September 23, 13
Discovery
• mDNS
• also called Bonjour, Avahi,
Rendevous, & Zeroconf
• DNS
• NIS
• hosts file
Monday, September 23, 13
Tools
• One of the beauties of following standards: other
people write the tools
• A Web service call can be made via a browser
• Firefox, Chrome, Safari, & Opera feature great tools
• cURL is freely available for Linux, Mac, and MS-Win
Monday, September 23, 13
Wrap-Up
• Following standards is good
• One benefits from the work of
others
• Others can more easily use
your products
Monday, September 23, 13
References
• http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
• http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
• http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
• http://www.w3.org/Addressing/
• http://json.org/
Monday, September 23, 13

Weitere ähnliche Inhalte

Andere mochten auch

Manantial fuentes de vida
Manantial fuentes de vidaManantial fuentes de vida
Manantial fuentes de vidaleory
 
Sorrento Centre BC Audited finanical statements 2011
Sorrento Centre BC Audited finanical statements 2011Sorrento Centre BC Audited finanical statements 2011
Sorrento Centre BC Audited finanical statements 2011Sorrento Centre
 
How to make it on kickstarter, with a video game project
How to make it on kickstarter, with a video game projectHow to make it on kickstarter, with a video game project
How to make it on kickstarter, with a video game projectZiv Kitaro
 
Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011Emporia State University
 
Scrum debrief to team
Scrum debrief to team Scrum debrief to team
Scrum debrief to team Krishna Sankar
 
Astigarragako sagar
Astigarragako sagarAstigarragako sagar
Astigarragako sagarzinkuu
 

Andere mochten auch (9)

Going Lean Way for Better UX
Going Lean Way for Better UXGoing Lean Way for Better UX
Going Lean Way for Better UX
 
Manantial fuentes de vida
Manantial fuentes de vidaManantial fuentes de vida
Manantial fuentes de vida
 
Accommodations
AccommodationsAccommodations
Accommodations
 
Sorrento Centre BC Audited finanical statements 2011
Sorrento Centre BC Audited finanical statements 2011Sorrento Centre BC Audited finanical statements 2011
Sorrento Centre BC Audited finanical statements 2011
 
How to make it on kickstarter, with a video game project
How to make it on kickstarter, with a video game projectHow to make it on kickstarter, with a video game project
How to make it on kickstarter, with a video game project
 
Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011
 
Scrum debrief to team
Scrum debrief to team Scrum debrief to team
Scrum debrief to team
 
OAP-Team Grayscale
OAP-Team GrayscaleOAP-Team Grayscale
OAP-Team Grayscale
 
Astigarragako sagar
Astigarragako sagarAstigarragako sagar
Astigarragako sagar
 

Ähnlich wie Web Services Introduction

NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationArjen Schoneveld
 
Art and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachArt and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachJiang Zhu
 
You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!Ben Ramsey
 
Grokking the REST Architectural Style
Grokking the REST Architectural StyleGrokking the REST Architectural Style
Grokking the REST Architectural StyleBen Ramsey
 
Bkbiet day1
Bkbiet day1Bkbiet day1
Bkbiet day1mihirio
 
HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams SecurityBlueinfy Solutions
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStationArabNet ME
 
Introduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitIntroduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitRan Mizrahi
 
Threadneedle when its just too slow
Threadneedle when its just too slowThreadneedle when its just too slow
Threadneedle when its just too slowDoug Sillars
 
Web technologies-course 01.pptx
Web technologies-course 01.pptxWeb technologies-course 01.pptx
Web technologies-course 01.pptxStefan Oprea
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 
Web Service and Mobile Integrated Day I
Web Service and Mobile Integrated Day IWeb Service and Mobile Integrated Day I
Web Service and Mobile Integrated Day IAnuchit Chalothorn
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesQanita Ahmad
 
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...Ryan Koop
 
Json Rpc Proxy Generation With Php
Json Rpc Proxy Generation With PhpJson Rpc Proxy Generation With Php
Json Rpc Proxy Generation With Phpthinkphp
 
Application layer chapter-9
Application layer chapter-9Application layer chapter-9
Application layer chapter-9Student
 
Mot cph when its just too slow
Mot cph when its just too slowMot cph when its just too slow
Mot cph when its just too slowDoug Sillars
 
Interop 2011 - Scaling Platform As A Service
Interop 2011 - Scaling Platform As A ServiceInterop 2011 - Scaling Platform As A Service
Interop 2011 - Scaling Platform As A ServicePatrick Chanezon
 

Ähnlich wie Web Services Introduction (20)

NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
 
Art and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end ApproachArt and Science of Web Sites Performance: A Front-end Approach
Art and Science of Web Sites Performance: A Front-end Approach
 
Thinking restfully
Thinking restfullyThinking restfully
Thinking restfully
 
You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!
 
Grokking the REST Architectural Style
Grokking the REST Architectural StyleGrokking the REST Architectural Style
Grokking the REST Architectural Style
 
Bkbiet day1
Bkbiet day1Bkbiet day1
Bkbiet day1
 
HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams Security
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStation
 
Introduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitIntroduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim Summit
 
Ch. x web performance
Ch. x web performanceCh. x web performance
Ch. x web performance
 
Threadneedle when its just too slow
Threadneedle when its just too slowThreadneedle when its just too slow
Threadneedle when its just too slow
 
Web technologies-course 01.pptx
Web technologies-course 01.pptxWeb technologies-course 01.pptx
Web technologies-course 01.pptx
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
Web Service and Mobile Integrated Day I
Web Service and Mobile Integrated Day IWeb Service and Mobile Integrated Day I
Web Service and Mobile Integrated Day I
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web Services
 
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...
CIW Lab with CoheisveFT: Get started in public cloud - Part 1 Cloud & Virtual...
 
Json Rpc Proxy Generation With Php
Json Rpc Proxy Generation With PhpJson Rpc Proxy Generation With Php
Json Rpc Proxy Generation With Php
 
Application layer chapter-9
Application layer chapter-9Application layer chapter-9
Application layer chapter-9
 
Mot cph when its just too slow
Mot cph when its just too slowMot cph when its just too slow
Mot cph when its just too slow
 
Interop 2011 - Scaling Platform As A Service
Interop 2011 - Scaling Platform As A ServiceInterop 2011 - Scaling Platform As A Service
Interop 2011 - Scaling Platform As A Service
 

Kürzlich hochgeladen

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 FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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 Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 DevelopersWSO2
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
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.pptxRustici 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 2024Victor Rentea
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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 Ontologyjohnbeverley2021
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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 ModelDeepika Singh
 
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 WorkerThousandEyes
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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 FMESafe Software
 
"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 ...Zilliz
 
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 challengesrafiqahmad00786416
 

Kürzlich hochgeladen (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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
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
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
"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
 

Web Services Introduction

  • 2. Web Services What Do They Do? How Do They Work? Wrap-Up HTTP Payload Headers Flavors Discovery ToolsReferences Questions Monday, September 23, 13
  • 3. What Do They Do? • What don’t they do? • Heavily used technology • Everyone knows the Web • Lots of developers create for the Web Monday, September 23, 13
  • 4. Out in the World • Most Web applications use Web Services • Many mobile apps use them • Many desktop applications use them • Even some command-line programs do Monday, September 23, 13
  • 5. How Do They Work? • A suite of standard technologies: • HTTP • URL • JSON, XML, YAML, etc. • DNS Monday, September 23, 13
  • 6. HTTP • Request • URL • Method • Headers • Payload • Response • Status Code • Headers • Payload • HTTP is stateless! Monday, September 23, 13
  • 8. HTTP Methods • Most Common •GET •POST •PUT •DELETE • Less Used •HEAD •OPTIONS •CONNECT •TRACE •PATCH Monday, September 23, 13
  • 9. HTTP Status Codes • All 3 digit numbers • 1xx: Informational • 2xx: Success • 3xx: Redirection • 4xx: Your Fault • 5xx: Our Fault Monday, September 23, 13
  • 10. HTTP Headers • A set of key-value pairs • There is an official set of keys • Convention enforces the correct use of keys • Handles authentication, caching, checksums, chunking, compression, cookies, formats, and sessions Monday, September 23, 13
  • 11. Payload • Can be anything needed, of any size • Can be compressed • Can have an MD5 checksum applied to it • Can be chunked into multiple pieces for easier consumption Monday, September 23, 13
  • 12. Payload Formats • A handful of textual formats are popular: • CSV, INI, JSON, RDF, TSV, TXT, XML, YAML • For data: CSV, RDF, TSV, TXT, & XML are popular • For configuration: INI, JSON, & YAML are popular • For documents: JSON, TXT, & XML are popular • For communications: JSON is most popular Monday, September 23, 13
  • 13. Why JSON? [Test] DC.Title = Test Data File DC.Description = Simple test to compare INI, JSON, XML, and YAML. DC.Creator = Eric W. Brown DC.Identifier = 1 DC.Subject[1] = Test DC.Subject[2] = INI DC.Subject[3] = JSON DC.Subject[4] = XML DC.Subject[5] = YAML DC.Subject[6] = Text DC.Type = Dataset DC.Coverage = Basic comparison of textual formats DC.Contributors[1] = Eric W. Brown DC.Language = en-US DC.Date = 2013/09/13 08:19:14.764159 GMT-4 DC.Rights = All Rights Reserved DC.Publisher = ZOLL Version = 1.0 INI { "DC.Title": "Test Data File", "DC.Description": "Simple test to compare INI, JSON, XML, and YAML.", "DC.Creator": "Eric W. Brown", "DC.Identifier": 1, "DC.Subject": ["Test", "INI", "JSON", "XML", "YAML", "Text"], "DC.Type": "Dataset", "DC.Coverage": "Basic comparison of textual formats", "DC.Contributors": ["Eric W. Brown"], "DC.Language": "en-US", "DC.Date": "2013/09/13 08:19:14.764159 GMT-4", "DC.Rights": "All Rights Reserved", "DC.Publisher": "ZOLL", "Version": 1.0 } JSON <?xml version="1.0" encoding="UTF-8" ?> <test xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en"> <dc:title>Test Data File</dc:title> <dc:description> Simple test to compare INI, JSON, XML, and YAML. </dc:description> <dc:creator>Eric W. Brown</dc:creator> <dc:identifier>1</dc:identifier> <subject> <dc:subject>Test</dc:subject> <dc:subject>INI</dc:subject> <dc:subject>JSON</dc:subject> <dc:subject>XML</dc:subject> <dc:subject>YAML</dc:subject> <dc:subject>Text</dc:subject> </subject> <dc:type>Dataset</dc:type> <dc:coverage>Basic comparison of textual formats</dc:coverage> <contributors> <dc:contributor>Eric W. Brown</dc:contributor> </contributors> <dc:language>en-US</dc:language> <dc:date>2013/09/13 08:19:14.764159 GMT-4</dc:date> <dc:rights>All Rights Reserved</dc:rights> <dc:publisher>ZOLL</dc:publisher> <version>1.0</version> </test> XML DC: Title: Test Data File Description: Simple test to compare INI, JSON, XML, and YAML. Creator: Eric W. Brown Identifier: 1 Subject: - Test - INI - JSON - XML - YAML - Text Type: Dataset Coverage: Basic comparison of textual formats Contributors: - Eric W. Brown Language: en-US Date: 2013/09/13 08:19:14.764159 GMT-4 Rights: All Rights Reserved Publisher: ZOLL Version: 1.0 YAML Monday, September 23, 13
  • 14. Read - Parse - Write & Size Comparisons (naïve & unscientific) % ./testINI.py 10.1204838753 % ./testJSON.py 8.89217090607 % ./testXML.py 9.28052902222 % ./testYAML.py 9.27972102165 % wc -c test.* 500 test.ini 333 test.ini.gz 490 test.json 337 test.json.gz 889 test.xml 462 test.xml.gz 627 test.yaml 331 test.yaml.gz 3969 total Monday, September 23, 13
  • 15. Flavors • A handful of popular options: • SOAP • XML-RPC • JSON-RPC • REST • REST is quickly becoming the most popular Monday, September 23, 13
  • 16. Why REST? Request: POST /GetEvent HTTP/1.1 Host: www.example.org Date: Wed, 31 Aug 2011 12:23:00 GMT Content-Type: application/soap+xml; charset=utf-8 Content-Length: 413 SOAPAction: "http://www.w3.org/2003/05/soap-envelope" <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ev="http://www.example.org/events"> <soap:Header> </soap:Header> <soap:Body> <ev:GetEvent xmlns:ev="http://www.example.org/GetEvent"> <ev:EventNumber>23</ev:EventNumber> </ev:GetEvent> </soap:Body> </soap:Envelope> Response: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:05 GMT Content-Type: application/soap+xml; charset=utf-8 Content-Length: 493 Server: Spiffy SOAP Server SOAPAction: "http://www.w3.org/2003/05/soap-envelope" <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ev="http://www.example.org/events"> <soap:Header> <ev:Date>2011-09-31T12:23:05-00:00</ev:Date> </soap:Header> <soap:Body> <ev:Event> <ev:Name>Saugus.net Ghost Story Contest Deadline</ev:Name> <ev:Date>October 22, 2011</ev:Date> <ev:Time>11:59:59 PM</ev:Time> </ev:Event> </soap:Body> </soap:Envelope> Fault: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:05 GMT Content-Type: application/soap+xml; charset=utf-8 Content-Length: 536 SOAPRequest: POST /GetEvent HTTP/1.1 Host: www.example.org Date: Wed, 31 Aug 2011 12:23:00 GMT Content-Type: application/xml; charset=utf-8 Content-Length: 177 <?xml version="1.0"?> <methodCall> <methodName>example.getEvent</methodName> <params> <param> <value><int>23</int></value> </param> </params> </methodCall> Response: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:02 GMT Content-Type: application/xml; charset=utf-8 Content-Length: 531 Server: Spiffy XMLRPC Server <?xml version="1.0"?> <methodResponse> <params> <param> <struct> <member> <name>Name</name> <value><string>Saugus.net Ghost Story Contest Deadline</string></value> </member> <member> <name>Date</name> <value><string>October 22, 2011</string></value> </member> <member> <name>Time</name> <value><string>11:59:59 PM</string></value> </member> </struct> </param> </params> </methodResponse> Fault: HTTP/1.0 200 OK XML-RPC Request: POST /events HTTP/1.1 Host: www.example.org Date: Wed, 31 Aug 2011 12:23:00 GMT Content-Type: application/json; charset=utf-8 Content-Length: 50 { "method":"GetEvent", "params":[23], "id":1 } Response: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:02 GMT Content-Type: application/json; charset=utf-8 Content-Length: 158 Server: Spiffy JSONRPC Server { "result":{ "Name":"Saugus.net Ghost Story Contest Deadline", "Date":"October 22, 2011", "Time":"11:59:59 PM" }, "error":null, "id":1 } Fault: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:02 GMT Content-Type: application/json; charset=utf-8 Content-Length: 93 Server: Spiffy JSONRPC Server { "result":null, "error":{ "fault":5, "reason":"No such event." }, "id":1 } JSON-RPC Request: GET /GetEvent/23 HTTP/1.1 Host: www.example.org Date: Wed, 31 Aug 2011 12:23:00 GMT Accept: application/json Response: HTTP/1.0 200 OK Date: Wed, 31 Aug 2011 12:23:01 GMT Content-Type: application/json; charset=utf-8 Content-Length: 108 Last-Modified: Tue, 30 Aug 2011 1:00:00 GMT Server: Spiffy REST Server { "Name":"Saugus.net Ghost Story Contest Deadline", "Date":"October 22, 2011", "Time":"11:59:59 PM" } Fault: HTTP/1.0 404 NOTFOUND Date: Wed, 31 Aug 2011 12:23:01 GMT Content-Type: application/json; charset=utf-8 Content-Length: 46 Server: Spiffy REST Server { "fault":5, "reason":"No such event." } REST Keeps Going! Keeps Going! Monday, September 23, 13
  • 17. Streaming • Chunking is good for large uploads or downloads • Not sufficient for two-way communications • Request / Response cycle has a lot of overhead • WebSockets solve this problem Monday, September 23, 13
  • 18. Discovery • mDNS • also called Bonjour, Avahi, Rendevous, & Zeroconf • DNS • NIS • hosts file Monday, September 23, 13
  • 19. Tools • One of the beauties of following standards: other people write the tools • A Web service call can be made via a browser • Firefox, Chrome, Safari, & Opera feature great tools • cURL is freely available for Linux, Mac, and MS-Win Monday, September 23, 13
  • 20. Wrap-Up • Following standards is good • One benefits from the work of others • Others can more easily use your products Monday, September 23, 13
  • 21. References • http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html • http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html • http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html • http://www.w3.org/Addressing/ • http://json.org/ Monday, September 23, 13