270 likes | 383 Views
This lecture delves into the essentials of web services and their architectures, focusing on the role of WSDL (Web Services Description Language), SOAP (Simple Object Access Protocol), and REST (Representational State Transfer). Discover how web services enable interoperability between applications and the significance of different service styles, including one-way, request-response, and notification mechanisms. We explore the benefits and trade-offs of SOAP and REST, showcasing their features, advantages, and real-world applications. Enhance your understanding of web services in modern software development.
E N D
Advanced Web Technologies Lecture #4 By: Faraz Ahmed
Contents • Personnel Requirements • SQA Tasks • 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? • Interoperability. • Reusability. • Connecting Existing Software. • Maintainability.
WSDL • Based on XML • Language for describing the service to clients. • Description {interactions, Inputs/Outputs, Location, Protocols, Data Formats} • Contract between Client and server developers. • Alternatives: Web Access Description Language
WSDL in its simplest form1 1 http://w3Schools.com
<portType> • One-way : The operation can receive a message but will not return a response • Request-response : The operation can receive a request and will return a response • Solicit-response : The operation can send a request and will wait for a response • 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 • Universal Description, Discovery and Integration (UDDI) for web Services registration. • Platform independent. • However lack of public UDDIs has harmed the initiative[3]. • UDDI Browser [4]
SOAP • Simple Object access Protocol • CORBA used to be difficult to use. • Alternatives: XML-RPC, JSON-RPC • The recommendations do not require the use of SOAP for webservices.
SOAP • Complex datatypes are easily shared as compared to the simplicity of others which hinder such sharing[5]. • SOAP services are loosely coupled as compared to their predecessors.
Sample Web Services • Google's Web Service - access the Google search engine • Amazon's Web Service - access Amazon's product information • XMethods • http://www.webservicex.net/ws/wscatlist.aspx
REST[6] • Representational State Transfer • Each URL represents a different state and that state is transferred. OPAQUE • Resources are key elements and identified by URIs • Anything of interest is a resource. • Gives rise to resource oriented architecture.
REST features • Client Server • Stateless • Cacheable • Layered System • Uniform interface
But why Stateless?? • Visibility : A server doesn’t have to look further • Reliability : Easy recovery from failures • Scalability : Limited utilization of server resources.
Uniform interface • identification of resources; • manipulation of resources through representations; • self-descriptive messages; and, • hypermedia as the engine of application state
The Power of URI • Maintaining a trail of what and how we got to the point
GET: fetch information • To 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 • GET is fundamental to browsers because mostly they just browse • REST requires a few more verbs to allow taking actions
Verbs • GET • POST • PUT • DELETE
REST vs. SOAP • REST • Lightweight - not a lot of extra xml markup • Human Readable Results • Easy to build - no toolkits required • Lower Learning Curve • Uses the same paradigm as HTTP • SOAP • Easy to consume - sometimes • Rigid - type checking, adheres to a contract • Development tools
Recommended Reading! • How I explained REST to my wife!!! [7]
Bibliography 1) “REST”, http://oreilly.com/catalog/pwebserperl/chapter/ch11.pdf, visited on 24th Jan 2011.
References • “Web Services Glossary”, http://www.w3.org/TR/ws-gloss/, visited 23rd Jan 2011. • “Which Style of WSDL should I use”, http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/, visited 23rd Jan 2011. • “IBM and Microsoft discontinue Public UDDI Registry”, http://www.webservicessummit.com/News/UDDI2006.htm, visited on 23rd Jan 2011. • “SOAP Client”, http://www.soapclient.com/uddisearch.html, visited on 23rd Jan 2011. • “XML-RPC vs. SOAP”, http://weblog.masukomi.org/writings/xml-rpc_vs_soap.htm, visited on 23rd Jan 2011. • “Representational State Transfer”, http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1, visited on 24th Jan 2011. • “How I explained REST to my wife”, http://tomayko.com/writings/rest-to-my-wife, visited on 24th Jan 2011.