advanced web technologies lecture #4 by: faraz ahmed

26
Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Upload: randolph-scott

Post on 20-Jan-2016

224 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Advanced Web TechnologiesLecture #4

By: Faraz Ahmed

Page 2: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Contents

0Personnel Requirements0SQA Tasks0 Improving SQA

Page 3: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

WebServices

“A software system designed to support interoperable machine-to-machine interaction over a network.” [1]

Page 4: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

WebServices (simple def)

A web service is just a web page meant for a computer to request and process

Page 5: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Benefits?

0 Interoperability.

0Reusability.

0Connecting Existing Software.

0Maintainability.

Page 6: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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

Page 7: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

WSDL in its simplest form1

1 http://w3Schools.com

Page 8: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

WSDL in its simplest form

Page 9: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

<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

Page 10: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Styles[2]

How to translate a WSDL into SOAP messages.

Document

RPC

Page 11: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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]

Page 12: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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.

Page 13: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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.

Page 14: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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

Page 15: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

The interaction

Page 16: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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.

Page 17: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

REST features

0Client Server

0Stateless

0Cacheable

0Layered System

0Uniform interface

Page 18: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

But why Stateless??

0Visibility : A server doesn’t have to look further

0Reliability : Easy recovery from failures

0Scalability : Limited utilization of server resources.

Page 19: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Uniform interface

0  identification of resources;

0 manipulation of resources through representations;

0 self-descriptive messages; and,

0hypermedia as the engine of application state

Page 20: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

The Power of URI

0Maintaining a trail of what and how we got to the point

Page 21: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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

Page 22: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Verbs

0GET

0POST

0PUT

0DELETE

Page 23: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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

Page 24: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Recommended Reading!

0How I explained REST to my wife!!! [7]

Page 25: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

Bibliography

1) “REST”, http://oreilly.com/catalog/pwebserperl/chapter/ch11.pdf, visited on 24th Jan 2011.

Page 26: Advanced Web Technologies Lecture #4 By: Faraz Ahmed

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.