Upload
randolph-scott
View
221
Download
3
Tags:
Embed Size (px)
Citation preview
Advanced Web TechnologiesLecture #4
By: Faraz Ahmed
Contents
0Personnel Requirements0SQA Tasks0 Improving SQA
WebServices
“A software system designed to support interoperable machine-to-machine interaction over a network.” [1]
WebServices (simple def)
A web service is just a web page meant for a computer to request and process
Benefits?
0 Interoperability.
0Reusability.
0Connecting Existing Software.
0Maintainability.
WSDL
0 Based on XML
0 Language for describing the service to clients.
0 Description {interactions, Inputs/Outputs, Location, Protocols, Data Formats}
0 Contract between Client and server developers.
0 Alternatives: Web Access Description Language
WSDL in its simplest form1
1 http://w3Schools.com
WSDL in its simplest form
<portType>
0 One-way : The operation can receive a message but will not return a response
0 Request-response : The operation can receive a request and will return a response
0 Solicit-response : The operation can send a request and will wait for a response
0 Notification : The operation can send a message but will not wait for a response
Styles[2]
How to translate a WSDL into SOAP messages.
Document
RPC
UDDI
0Universal Description, Discovery and Integration (UDDI) for web Services registration.
0Platform independent.
0However lack of public UDDIs has harmed the initiative[3].
0UDDI Browser [4]
SOAP
0Simple Object access Protocol
0CORBA used to be difficult to use.
0Alternatives: XML-RPC, JSON-RPC
0The recommendations do not require the use of SOAP for webservices.
SOAP
0Complex datatypes are easily shared as compared to the simplicity of others which hinder such sharing[5].
0SOAP services are loosely coupled as compared to their predecessors.
Sample Web Services
0Google's Web Service - access the Google search engine
0Amazon's Web Service - access Amazon's product information
0XMethods
0http://www.webservicex.net/ws/wscatlist.aspx
The interaction
REST[6]
0 Representational State Transfer
0 Each URL represents a different state and that state is transferred. OPAQUE
0 Resources are key elements and identified by URIs
0 Anything of interest is a resource.
0 Gives rise to resource oriented architecture.
REST features
0Client Server
0Stateless
0Cacheable
0Layered System
0Uniform interface
But why Stateless??
0Visibility : A server doesn’t have to look further
0Reliability : Easy recovery from failures
0Scalability : Limited utilization of server resources.
Uniform interface
0 identification of resources;
0 manipulation of resources through representations;
0 self-descriptive messages; and,
0hypermedia as the engine of application state
The Power of URI
0Maintaining a trail of what and how we got to the point
GET: fetch information
0To fetch a web page, the browser does a GET on some URI and retrieves a representation (HTML, plain text, JPEG, or whatever) of the resource identified by that URI
0GET is fundamental to browsers because mostly they just browse
0REST requires a few more verbs to allow taking actions
Verbs
0GET
0POST
0PUT
0DELETE
REST vs. SOAP
0 REST0 Lightweight - not a lot of extra xml markup0 Human Readable Results0 Easy to build - no toolkits required0 Lower Learning Curve0 Uses the same paradigm as HTTP
0 SOAP 0 Easy to consume - sometimes0 Rigid - type checking, adheres to a contract0 Development tools
Recommended Reading!
0How I explained REST to my wife!!! [7]
Bibliography
1) “REST”, http://oreilly.com/catalog/pwebserperl/chapter/ch11.pdf, visited on 24th Jan 2011.
References1) “Web Services Glossary”, http://www.w3.org/TR/ws-gloss/, visited 23rd Jan 2011.2) “Which Style of WSDL should I use”,
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/, visited 23rd Jan 2011.
3) “IBM and Microsoft discontinue Public UDDI Registry”, http://www.webservicessummit.com/News/UDDI2006.htm, visited on 23rd Jan 2011.
4) “SOAP Client”, http://www.soapclient.com/uddisearch.html, visited on 23rd Jan 2011.
5) “XML-RPC vs. SOAP”, http://weblog.masukomi.org/writings/xml-rpc_vs_soap.htm, visited on 23rd Jan 2011.
6) “Representational State Transfer”, http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1, visited on 24th Jan 2011.
7) “How I explained REST to my wife”, http://tomayko.com/writings/rest-to-my-wife, visited on 24th Jan 2011.