SlideShare a Scribd company logo
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

More Related Content

Viewers also liked

Going Lean Way for Better UX
Going Lean Way for Better UXGoing Lean Way for Better UX
Going Lean Way for Better UX
WinWire Technologies Inc
 
Manantial fuentes de vida
Manantial fuentes de vidaManantial fuentes de vida
Manantial fuentes de vida
leory
 
Accommodations
AccommodationsAccommodations
Accommodations
Sorrento Centre
 
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
Sorrento 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 project
Ziv Kitaro
 
Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011Introduction to intellectual property oct 2011
Introduction to intellectual property oct 2011
Emporia State University
 
Scrum debrief to team
Scrum debrief to team Scrum debrief to team
Scrum debrief to team
Krishna Sankar
 
OAP-Team Grayscale
OAP-Team GrayscaleOAP-Team Grayscale
OAP-Team Grayscale
GREE Ventures
 
Astigarragako sagar
Astigarragako sagarAstigarragako sagar
Astigarragako sagar
zinkuu
 

Viewers also liked (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
 

Similar to Web Services Introduction

NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
Arjen 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 Approach
Jiang Zhu
 
Thinking restfully
Thinking restfullyThinking restfully
Thinking restfully
Stelios Gorilas
 
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 Style
Ben Ramsey
 
Bkbiet day1
Bkbiet day1Bkbiet day1
Bkbiet day1
mihirio
 
HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams Security
Blueinfy Solutions
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStation
ArabNet 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 Summit
Ran Mizrahi
 
Ch. x web performance
Ch. x web performanceCh. x web performance
Ch. x web performance
Manolis Vavalis
 
Threadneedle when its just too slow
Threadneedle when its just too slowThreadneedle when its just too slow
Threadneedle when its just too slow
Doug Sillars
 
Web technologies-course 01.pptx
Web technologies-course 01.pptxWeb technologies-course 01.pptx
Web technologies-course 01.pptx
Stefan Oprea
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
clkao
 
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
Anuchit 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 Services
Qanita 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 Php
thinkphp
 
Application layer chapter-9
Application layer chapter-9Application layer chapter-9
Application layer chapter-9
Student
 
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
Doug 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 Service
Patrick Chanezon
 

Similar to 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
 

Recently uploaded

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

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