SlideShare a Scribd company logo
Submit Search
Upload
Architecting Web Services
Report
L
Lorna Mitchell
PHP Developer at self-employed
Follow
•
6 likes
•
3,815 views
1
of
44
Architecting Web Services
•
6 likes
•
3,815 views
Download Now
Download to read offline
Report
Technology
L
Lorna Mitchell
PHP Developer at self-employed
Follow
Recommended
XML and Web Services with PHP5 and PEAR
Stephan Schmidt
9.3K views
•
253 slides
Inroduction to XSLT with PHP4
Stephan Schmidt
959 views
•
49 slides
XML processing with perl
Joe Jiang
927 views
•
11 slides
A simple ReSTful webservice for the Goblins (v. 0.5)
Danilo Sanchi
452 views
•
30 slides
JSP Custom Tags
BG Java EE Course
5.3K views
•
21 slides
The Big Documentation Extravaganza
Stephan Schmidt
1.8K views
•
44 slides
More Related Content
What's hot
Processing XML with Java
BG Java EE Course
2K views
•
65 slides
Open Source Package Php Mysql 1228203701094763 9
isadorta
1.5K views
•
29 slides
PHP MySQL
Md. Sirajus Salayhin
2.6K views
•
29 slides
PHPTAL introduction
'"">
814 views
•
11 slides
JavaScript and jQuery Fundamentals
BG Java EE Course
6K views
•
80 slides
Grddl In A Nutshell V1
Fabien Gandon
1.9K views
•
34 slides
What's hot
(20)
Processing XML with Java
BG Java EE Course
•
2K views
Open Source Package Php Mysql 1228203701094763 9
isadorta
•
1.5K views
PHP MySQL
Md. Sirajus Salayhin
•
2.6K views
PHPTAL introduction
'"">
•
814 views
JavaScript and jQuery Fundamentals
BG Java EE Course
•
6K views
Grddl In A Nutshell V1
Fabien Gandon
•
1.9K views
WWW and HTTP
BG Java EE Course
•
1.2K views
Joomla security nuggets
guestbd1cdca
•
3.6K views
Php and MySQL
Tiji Thomas
•
29.5K views
Xhtml 2010
guest0f1e7f
•
1.4K views
Go OO! - Real-life Design Patterns in PHP 5
Stephan Schmidt
•
5.1K views
Ellerslie User Group - ReST Presentation
Alex Henderson
•
529 views
PHP MySQL Workshop - facehook
Brainware Consultancy Pvt Ltd
•
4.7K views
Java script
Fajar Baskoro
•
8.1K views
JSP custom tags
Nabeel Aron
•
220 views
<img src="../i/r_14.png" />
tutorialsruby
•
319 views
Php
mohamed ashraf
•
445 views
Dynamic Web Pages Ch 1 V1.0
Cathie101
•
1.9K views
JavaScript APIs In Focus
Sergey Ilinsky
•
826 views
Phpvsjsp
guest5b4d24
•
1.8K views
Similar to Architecting Web Services
SPARQLing Services
Leigh Dodds
822 views
•
47 slides
Blogs and RSS
Jason Rhode
385 views
•
6 slides
Introduction to XML
BG Java EE Course
3.5K views
•
56 slides
Spring Surf 101
Alfresco Software
2.8K views
•
30 slides
Putting SOAP to REST
Igor Moochnick
1.9K views
•
23 slides
REST dojo Comet
Carol McDonald
3K views
•
89 slides
Similar to Architecting Web Services
(20)
SPARQLing Services
Leigh Dodds
•
822 views
Blogs and RSS
Jason Rhode
•
385 views
Introduction to XML
BG Java EE Course
•
3.5K views
Spring Surf 101
Alfresco Software
•
2.8K views
Putting SOAP to REST
Igor Moochnick
•
1.9K views
REST dojo Comet
Carol McDonald
•
3K views
Lecture 3 - Comm Lab: Web @ ITP
yucefmerhi
•
374 views
Creating Yahoo Mobile Widgets
Ricardo Varela
•
1.7K views
Introduction To Lamp
Amzad Hossain
•
603 views
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
guest517f2f
•
520 views
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Pamela Fox
•
1.3K views
DevDays09 Internet Explorer 8
Konstantinos Pantos
•
1.5K views
Migration testing framework
IndicThreads
•
447 views
Struts2
yuvalb
•
2.7K views
RSS
Jason Rhode
•
419 views
Introduction To Xml
bdebruin
•
809 views
Jsp
DSKUMAR G
•
1.4K views
Alfresco Search Internals
Alfresco Software
•
4.9K views
The Basics Of Page Creation
Wildan Maulana
•
473 views
Apache Camel - WJax 2008
inovex GmbH
•
755 views
More from Lorna Mitchell
OAuth: Trust Issues
Lorna Mitchell
2.7K views
•
45 slides
Web Services PHP Tutorial
Lorna Mitchell
192.2K views
•
78 slides
Best Practice in API Design
Lorna Mitchell
3.7K views
•
40 slides
Git, GitHub and Open Source
Lorna Mitchell
2.2K views
•
40 slides
Business 101 for Developers: Time and Money
Lorna Mitchell
1.1K views
•
37 slides
Things I wish web graduates knew
Lorna Mitchell
1.4K views
•
38 slides
More from Lorna Mitchell
(20)
OAuth: Trust Issues
Lorna Mitchell
•
2.7K views
Web Services PHP Tutorial
Lorna Mitchell
•
192.2K views
Best Practice in API Design
Lorna Mitchell
•
3.7K views
Git, GitHub and Open Source
Lorna Mitchell
•
2.2K views
Business 101 for Developers: Time and Money
Lorna Mitchell
•
1.1K views
Things I wish web graduates knew
Lorna Mitchell
•
1.4K views
Teach a Man To Fish (phpconpl edition)
Lorna Mitchell
•
2K views
Web services tutorial
Lorna Mitchell
•
15K views
Join In With Joind.In
Lorna Mitchell
•
2K views
Tool Up Your LAMP Stack
Lorna Mitchell
•
3.9K views
Going Freelance
Lorna Mitchell
•
755 views
Understanding Distributed Source Control
Lorna Mitchell
•
1.5K views
Best Practice in Web Service Design
Lorna Mitchell
•
2K views
Coaching Development Teams: Teach A Man To Fish
Lorna Mitchell
•
1.4K views
Zend Certification Preparation Tutorial
Lorna Mitchell
•
24.3K views
Implementing OAuth with PHP
Lorna Mitchell
•
40.1K views
Web Services Tutorial
Lorna Mitchell
•
13.2K views
Object Oriented Programming in PHP
Lorna Mitchell
•
3.9K views
Example Presentation
Lorna Mitchell
•
1K views
Could You Telecommute?
Lorna Mitchell
•
730 views
Recently uploaded
.conf Go 2023 - SIEM project @ SNF
Splunk
163 views
•
18 slides
ChatGPT and AI for Web Developers
Maximiliano Firtman
152 views
•
82 slides
AMD: 4th Generation EPYC CXL Demo
CXL Forum
117 views
•
6 slides
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya
51 views
•
25 slides
CXL at OCP
CXL Forum
183 views
•
66 slides
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang
34 views
•
1 slide
Recently uploaded
(20)
.conf Go 2023 - SIEM project @ SNF
Splunk
•
163 views
ChatGPT and AI for Web Developers
Maximiliano Firtman
•
152 views
AMD: 4th Generation EPYC CXL Demo
CXL Forum
•
117 views
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya
•
51 views
CXL at OCP
CXL Forum
•
183 views
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang
•
34 views
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst
•
389 views
Micron CXL product and architecture update
CXL Forum
•
23 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin
•
45 views
Samsung: CMM-H Tiered Memory Solution with Built-in DRAM
CXL Forum
•
96 views
.conf Go 2023 - Data analysis as a routine
Splunk
•
76 views
"How we switched to Kanban and how it integrates with product planning", Vady...
Fwdays
•
59 views
"Thriving Culture in a Product Company — Practical Story", Volodymyr Tsukur
Fwdays
•
35 views
[2023] Putting the R! in R&D.pdf
Eleanor McHugh
•
34 views
GigaIO: The March of Composability Onward to Memory with CXL
CXL Forum
•
118 views
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation
•
23 views
Five Things You SHOULD Know About Postman
Postman
•
20 views
Level-up Your Cloud Visibility Into AWS With ThousandEyes
ThousandEyes
•
74 views
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum
•
108 views
.conf Go 2023 - Many roads lead to Rome - this was our journey (Julius Bär)
Splunk
•
172 views
Architecting Web Services
1.
Architecting Web Services
Lorna Mitchell, Ibuildings
2.
3.
PHP community evangelist
4.
Blog at
http://lornajane.net
5.
6.
For local or
remote consumption
7.
For consumption by
discrete/modular systems
8.
Why Web Services
9.
Why Web Services
10.
Why Web Services
11.
Why Web Services
12.
13.
SOAP
14.
REST (REpresentational State
Transfer)
15.
16.
Parameters give method
names
17.
Request body can
take a variety of formats
18.
19.
Can abstract between
existing systems
20.
Familiar functional paradigm
21.
RPC Example Flickr's
XML-RPC Request <methodCall> <methodName> flickr.test.echo </methodName> <params> <param><value><struct> <member> <name> name </name> <value><string> value </string></value> </member> <member> <name> name2 </name> <value><string> value2 </string></value> </member> </struct></value></param> </params> </methodCall>
22.
RPC Example Flickr's
XML-RPC Response <?xml version="1.0" encoding="utf-8" ?> <methodResponse> <params> <param> <value> <string> [escaped-xml-payload] </string> </value> </param> </params> </methodResponse>
23.
24.
Docs of functions
and arguments
25.
If this was
an existing system, existing docs may suffice
26.
27.
Has given formats
for messages and errors
28.
Libraries exist for
creating server and client in most languages
29.
PHP SOAP Server
Example require_once('lib/myClass.php'); ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer("service.wsdl"); $server->setClass("MyClass"); $server->handle();
30.
PHP SOAP Client
Example ini_set('soap.wsdl_cache_enabled','0'); require_once('lib/Snapshot.php'); $wsdl = "Service.wsdl"; $client = new SoapClient($wsdl, $params); $output = $client->requestShot( 'http://www.php.net','', 300, 400);
31.
32.
Widely used with
SOAP
33.
Describes the methods,
arguments and data types available
34.
IDEs can read
this and hint
35.
Validity of requests
is checked before they are sent
36.
WSDL <?xml version
='1.0' encoding ='UTF-8' ?> <definitions name='MyClass' targetNamespace='urn:MyClassInventory' xmlns:tns='urn:MyClassInventory' xmlns:soap=' http://schemas.xmlsoap.org/wsdl/soap/ ' xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' xmlns:soapenc=' http://schemas.xmlsoap.org/soap/encoding/ ' xmlns:wsdl=' http://schemas.xmlsoap.org/wsdl/ ' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message> <portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType> <binding name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service> </definitions>
37.
38.
Otherwise method names,
arguments and types will be needed
39.
40.
Generally uses HTTP
(HyperText Transfer Protocol)
41.
URLs are resource
locations
42.
Verbs tell the
service what to do
43.
Status codes indicate
what the outcome was
44.
45.
Routing to map
requests to internal functionality
46.
Output not always
HTML
47.
48.
POST http://example.com/users
49.
PUT http://example.com/users/lorna
50.
GET http://example.com/users
51.
52.
Must include information
about error handling
53.
54.
REST is full
of great ideas
55.
REST is great
for clean, simple, robust services
56.
57.
General Architecture Considerations
58.
Machine-Readable Formats 1111011110101000001101011011110001001101011111011000101010001011010100001110110111101001111110011100110010100110011000111100011000000111100000011001001101000001011100101101011011100010010111000001111010000100100010010101010101110110000000100101101110100000111001000010100010011111111010001010110000010100000101011000001000000100110000100100110010101001110101100001010110001111000101110111011110010011110101101100110111100111101000001010100100110111001111111010000000000111000000011101000000010011001101100110000101011111010100111011100100000000111010010110100011110110111000011100000010111010010011111011001001010110111011111101110000011111100010010000011010100010010011100000111111101100111111000001000100101011011100001101111011100010101010011000000100011011010000111010000000001100010011011011010010000101110111110110111101110111000111010100001001101011010101110101010100111000010110001110001111001011100011110100000110100110000000100011101011010010011100111011001111111011111000011101000111100110
59.
60.
JSON (JavaScript Object
Notation)
61.
Key/value pairs
62.
Form variables
63.
Background: XML <menu
id="file" value="File"> <popup> <menuitem value="New" onclick="CreateNewDoc()" /> <menuitem value="Open" onclick="OpenDoc()" /> <menuitem value="Close" onclick="CloseDoc()" /> </popup> </menu>
64.
Background: JSON {"menu":
{ "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }}
65.
66.
JSON easier for
JavaScript, use with AJAX-esque requests
67.
Or make both
available
68.
Use built-in libraries
for your platform
69.
70.
How about incorrect
data types? Cast or reject?
71.
Make error messages
meaningful and unique
72.
73.
Manage job queues
and retries
74.
Will users poll
for a change?
75.
Could implement callbacks
76.
77.
The preferred response
format
78.
79.
Can be convenient
80.
Consider performance
81.
82.
http://uk.php.net/sca
83.
http://benramsey.com
84.
http://lornajane.net
85.
86.
WSDL <?xml version
='1.0' encoding ='UTF-8' ?> <definitions name='MyClass' targetNamespace='urn:MyClassInventory' xmlns:tns='urn:MyClassInventory' xmlns:soap=' http://schemas.xmlsoap.org/wsdl/soap/ ' xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' xmlns:soapenc=' http://schemas.xmlsoap.org/soap/encoding/ ' xmlns:wsdl=' http://schemas.xmlsoap.org/wsdl/ ' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message> <portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType> <binding name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service> </definitions>
87.
WSDL: Service <service
name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service>
88.
WSDL <?xml version
='1.0' encoding ='UTF-8' ?> <definitions name='MyClass' targetNamespace='urn:MyClassInventory' xmlns:tns='urn:MyClassInventory' xmlns:soap=' http://schemas.xmlsoap.org/wsdl/soap/ ' xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' xmlns:soapenc=' http://schemas.xmlsoap.org/soap/encoding/ ' xmlns:wsdl=' http://schemas.xmlsoap.org/wsdl/ ' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message> <portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType> <binding name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service> </definitions>
89.
WSDL: Binding <binding
name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding>
90.
WSDL <?xml version
='1.0' encoding ='UTF-8' ?> <definitions name='MyClass' targetNamespace='urn:MyClassInventory' xmlns:tns='urn:MyClassInventory' xmlns:soap=' http://schemas.xmlsoap.org/wsdl/soap/ ' xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' xmlns:soapenc=' http://schemas.xmlsoap.org/soap/encoding/ ' xmlns:wsdl=' http://schemas.xmlsoap.org/wsdl/ ' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message> <portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType> <binding name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service> </definitions>
91.
WSDL: Port Type
<portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType>
92.
WSDL <?xml version
='1.0' encoding ='UTF-8' ?> <definitions name='MyClass' targetNamespace='urn:MyClassInventory' xmlns:tns='urn:MyClassInventory' xmlns:soap=' http://schemas.xmlsoap.org/wsdl/soap/ ' xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' xmlns:soapenc=' http://schemas.xmlsoap.org/soap/encoding/ ' xmlns:wsdl=' http://schemas.xmlsoap.org/wsdl/ ' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message> <portType name='MyClassPortType'> <operation name='getAccountStatus'> <input message='tns:getAccountStatusRequest'/> <output message='tns:getAccountStatusResponse'/> </operation> </portType> <binding name='MyClassBinding' type='tns:MyClassPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAccountStatus'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAccountStatus'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='MyClassService'> <port name='MyClassPort' binding='tns:MyClassBinding'> <soap:address location='http://rivendell.local:10002/MyClassServiceServer.php'/> </port> </service> </definitions>
93.
WSDL: Message <message
name='getAccountStatusRequest'> <part name='accountID' type='xsd:string'/> </message> <message name='getAccountStatusResponse'> <part name='accountID' type='xsd:string'/> <part name='counter' type='xsd:float' /> </message>