Web-Based Information Everyday Activity Systems The Web has - - PowerPoint PPT Presentation

web based information everyday activity systems
SMART_READER_LITE
LIVE PREVIEW

Web-Based Information Everyday Activity Systems The Web has - - PowerPoint PPT Presentation

Web-Based Information Everyday Activity Systems The Web has primarily been people interacting Fall 2006 with Web applications. CMPUT 410: Web Services What about applications interacting with Web Applications? Dr. Osmar R. Zaane


slide-1
SLIDE 1

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

1

Web-Based Information Systems

  • Dr. Osmar R. Zaïane

University of Alberta

Fall 2006

CMPUT 410: Web Services

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

2

Everyday Activity

  • The Web has primarily been people interacting

with Web applications.

  • What about applications interacting with Web

Applications?

“The Web can grow significantly in power and scope The Web can grow significantly in power and scope if it is extended to support communication between if it is extended to support communication between applications, from one program to another. applications, from one program to another.” ”

  • From the W3C XML Protocol Working Group Charter

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

3

  • Perl & Cookies
  • SGML / XML
  • CORBA & SOAP
  • Web Services
  • Search Engines
  • Recommender Syst.
  • Web Mining
  • Security Issues
  • Selected Topics

Course Content

  • Introduction
  • Internet and WWW
  • Protocols
  • HTML and beyond
  • Animation & WWW
  • CGI & HTML Forms
  • Javascript
  • Databases & WWW
  • Dynamic Pages

Web Services

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

4

Objectives of Lecture 13

Web Services Web Services

  • Discuss about a standardized framework for

standardized framework for applications to communicate over the applications to communicate over the internet internet

  • Get a general idea about the models of web

services

slide-2
SLIDE 2

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

5

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

6

Most Web Application Development Today

Local Services and Data App Code

Web app developers took advantage of these local services and used HTML to “project” the UI to lots of clients. Web app developers took advantage of these local services and used HTML to “project” the UI to lots of clients.

Browsers Browsers Internet

Historically, most development efforts have been directed toward building apps using rich local services. Historically, most development efforts have been directed toward building apps using rich local services. All services need to be local to the server. All services need to be local to the server.

If distributed services are needed, implementation details, service deployment, security issues, etc., need to be understood and apriori agreed upon by client and server. If distributed services are needed, implementation details, service deployment, security issues, etc., need to be understood and apriori agreed upon by client and server.

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

7

Motivating Example

Local Services and Data App Code Internet Weather in Edmonton?

Edmonton Temperature =-10C

Temperature in Edmonton?

HTML Parsing

Edmonton Temperature =-10C Web Services

Temperature in Edmonton? App Code

  • 10°C

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

8

Future Web Application Development

OS and Local Services App Code

Application Specific Web Services Building Block Web Services Vertical and Portal Services Devices Browsers

Internet

Web Service Communications

  • 1. Message-based (robust and scalable)
  • 2. Synchronous & Asyn. communications model
  • 3. XML (easy to specify, modify, & extend)
  • 4. Web protocols (universal access)

Web Service Communications

  • 1. Message-based (robust and scalable)
  • 2. Synchronous & Asyn. communications model
  • 3. XML (easy to specify, modify, & extend)
  • 4. Web protocols (universal access)

Web Services are building blocks that enable developers to build and aggregate applications and services from local and remote resources for a range of clients. Web Services are building blocks that enable developers to build and aggregate applications and services from local and remote resources for a range of clients.

slide-3
SLIDE 3

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

9

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

10

What are Web Services?

  • Identified by a URI
  • Interfaces defined using XML
  • Can be discovered by other systems
  • Interact using XML based messages conveyed by

Internet protocols

  • Platform neutral
  • Open Standards (Interoperable)
  • Based on ubiquitous software

– XML Parsers – HTTP Server Source: Web Services Glossary

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

11

What are Web Services?

XML Application 2 Application 1

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

12

Web Service Components

  • To discover where you can get web services and

what businesses have to offer – UDDI

  • To describe a web service and how to interact with

it – WSDL

  • To package your interaction with the Web Service

– SOAP

  • To carry the data envelope across the internet –

HTTP Post

  • To fragment and deliver the http post request to

the end point = TCP/IP

slide-4
SLIDE 4

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

13

Publish-Discover-Bind Model

Registry

Web Service

Client Client

1-Publish 2-Discover 3-Bind 4-Use Generic Web Service Client &Web Service known to each other

Web Service

Client Client

1-Bind 2-Use

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

14

Transport Layer for Web Services

  • HTTP POST is most common
  • But other protocols such as

– FTP – SMTP – HTTP GET

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

15

Web Services

  • Programmatic access to services
  • f Web site
  • Allow for rich, dynamic communication

between applications “Components for the Web”

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

16

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic
slide-5
SLIDE 5

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

17

Web Services and SOAP

  • A common standard that can be used to describe

data that is platform and language neutral – XML

  • A common wire format protocol that is platform

and language neutral – SOAP

  • A common contract language for describing

web services – WSDL

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

18

What Is SOAP?

  • Simple Object Access Protocol
  • Lightweight XML-based messaging

format Works with:

– Any operating system – Any programming language – Any platform

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

19

What Is A SOAP Message?

SOAP Message SOAP Envelope SOAP Header SOAP Body Message Name & Data Headers Protocol Headers XML Encoded SOAP XML Encoded SOAP Message Name and Data Message Name and Data < <Body> contains SOAP Body> contains SOAP Message Name and Data Message Name and Data Individual headers Individual headers < <Header> encloses headers Header> encloses headers < <Envelope> encloses payload Envelope> encloses payload Standard Protocol (HTTP, SMTP, etc.) Standard Protocol (HTTP, SMTP, etc.) and SOAP Headers and SOAP Headers The complete SOAP Message The complete SOAP Message

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

20

Simple SOAP Request

(Using HTTP)

POST / POST /TempService TempService HTTP/1.1 HTTP/1.1 Host: www.weather.com Host: www.weather.com Content Content-

  • Type: text/xml;

Type: text/xml; charset charset="utf ="utf-

  • 8

8“ “ Content Content-

  • Length: 290

Length: 290 SOAPAction SOAPAction: Some : Some-

  • Namespace

Namespace-

  • URI#GetTemperatureRequest

URI#GetTemperatureRequest <SQ:Envelope <SQ:Envelope

xmlns:SQ xmlns:SQ="http:// ="http://schemas.xmlsoap.org schemas.xmlsoap.org/soap/envelope/" /soap/envelope/" SQ:encodingStyle SQ:encodingStyle="http:// ="http://schemas.xmlsoap.org schemas.xmlsoap.org/soap/encoding/" /soap/encoding/"

> > <SQ:Body> <SQ:Body> < <m: m:getTemperatureRequest getTemperatureRequest xmlns:m xmlns:m="Some ="Some-

  • Namespace

Namespace-

  • URI">

URI"> <city>Edmonton</city> <city>Edmonton</city> </ </m: m:getTemperatureRequest getTemperatureRequest> > </SQ:Body> </SQ:Body> </SQ:Envelope> </SQ:Envelope>

slide-6
SLIDE 6

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

21

Simple SOAP Response

(Using HTTP)

HTTP/1.1 200 OK HTTP/1.1 200 OK Content Content-

  • Type: text/xml;

Type: text/xml; charset charset="utf ="utf-

  • 8

8“ “ Content Content-

  • Length: 336

Length: 336 < <SP:Envelope SP:Envelope

xmlns:SP xmlns:SP="http:// ="http://schemas.xmlsoap.org schemas.xmlsoap.org/soap/envelope/" /soap/envelope/" SP:encodingStyle SP:encodingStyle=" ="http:// http://schemas.xmlsoap.org schemas.xmlsoap.org/soap/encoding/ /soap/encoding/" "

> > < <SP:Body SP:Body> > < <m:getTemperatureResponse m:getTemperatureResponse xmlns:m xmlns:m="Some ="Some-

  • Namespace

Namespace-

  • URI">

URI"> <Temperature> <Temperature>-

  • 10</Temperature>

10</Temperature> <Unit> <Unit>Celcius Celcius</Unit> </Unit> </ </m:getTemperatureResponse m:getTemperatureResponse> > </ </SP:Body SP:Body> > </ </SP:Envelope SP:Envelope> >

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

22

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

23

Processing and Interaction Models

  • Processing Model: How a web service

processes a request at the server side

– Business Object-centric – Document-centric

  • Interaction Model: How clients invoke and

use a service

– Synchronous – Asynchronous

  • Most web services mix and match models
  • Whether RPC-oriented or document-oriented, web services use XML

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

24

Processing Models

  • Business Object-centric (or object-centric)

– Driven by a series of method calls that apply a business logic – Example: credit card authorization

  • Document-centric

– The service receives an XML document that contains data and no explicit binding to the business logic that is to be applied – XML document content determines processing workflow. – Example: travel agency, document contains itinerary

slide-7
SLIDE 7

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

25

Interaction Models

  • The model encompasses the client’s interaction

with the web service: can be synchronous, asynchronous or a combination.

  • Synchronous

– Application typically uses an RPC-oriented interaction – Request is mapped to a method call – authorizeCreditCardRequest(CreditCard, CardDetails)

  • Asynchronous

– Typically associated with document-centric processing – Client sends request, server receives and processes

  • request. Results sent when processing is completed

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

26

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

27

What Is WSDL?

  • A Web Service Description Language (WSDL) is:

– An XML-based grammar for describing the capabilities of Web Services (used to describe and locate web services) – Extensible (but not yet an W3C standard) – Similar in concept to IDL, but it’s not IDL

  • IDL is platform dependent
  • WSDL is platform independent

XML document that specifies the location of the service and the

  • perations (or methods) the service exposes.

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

28

The WSDL Document Structure

A WSDL document defines a web service using these major elements:

Elem ent Defines < portType> The operations performed by the web service < message> The messages used by the web service < types> The data types used by the web service < binding> The communication protocols used by the web service

The main structure of a WSDL document looks like this: <definitions> <types> definition of types........ </types> <message> definition of a message.... </message> <portType> definition of a port....... </portType> <binding> definition of a binding.... </binding> <service> definition of endpoint…</service> </definitions>

  • ther elements are also possible
slide-8
SLIDE 8

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

29

WSDL Elements

  • WSDL Ports
  • WSDL Messages
  • WSDL Types
  • WSDL Bindings

The <binding> element defines the message format & protocol details for each port. The <types> element defines the data type that are used by the web service. WSDL uses XML Schema syntax to define data types (platform neutrality). The <message> element defines the data elements of an operation. Each messages can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language. The <portType> element is the most important WSDL element. It defines a web service, the operations that can be performed, and the messages that are involved. The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language.

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

30

WSDL Example

<message name="getTemperatureRequest"> <part name="term" type="xs:string"/> </message> <message name="getTemperatureResponse"> <part name="value" type="xs:string"/> </message> <portType name=“cityTemperature"> <operation name="getTemperature"> <input message="getTemperatureRequest"/> <output message="getTemperatureResponse"/> </operation> </portType>

The message elements defines the parts of each message and the associated data types.

Library function Input and output parameters

Function Operation can have different type:

  • Request-response
  • One-way
  • Solicit-response
  • Notification

Simplified fraction of a WSDL document

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

31

Binding

  • In the <binding> element we can define a style of binding

and a transport method using the <soap:binding> element

  • The style attribute can be "rpc" or "document".
  • The transport attribute defines the SOAP protocol to use.

HTTP or other.

<binding type=“cityTemperature" name=“ct"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://celsius.com/getTemperature"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> document

  • r RPC

literal or encoding

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

32

What is the UDDI?

(Universal Description, Discovery and Integration)

  • It is a directory for storing information about web services
  • UDDI uses WSDL to describe interfaces to web services and

communicates via SOAP

  • “standard” for businesses to reach their customers and partners with

information about their products & services.

  • Makes it possible to discover the right business from the many

currently online

  • Defines how to enable commerce (communication) once the

preferred business/partner is discovered.

  • UDDI is a cross-industry effort driven by all major platform and

software providers

slide-9
SLIDE 9

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

33

Outline of Lecture 13

  • Evolution in Web applications
  • What is this web service paradigm?
  • SOAP Revisited
  • Models of Web Services
  • WSDL and UDDI
  • Scenarios dictated by business logic

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

34

One-on-One No Discovery

Registry

Web Service

Client Client

1-Bind 2-Use

One-on-One With Discovery

Client Client

Web Service

3-Bind 4-Use Acts as a web service 1-Request 2-Address

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

35

Polling

Registry

Web Service 1

Client Client

Web Service 2

3

  • R

e q u e s t

2-Addresses

Web Service n

Poll all or stop when needed

  • Use Best response
  • Use Subset

1-Request

5-Request 6-Response 4

  • R

e s p

  • n

s e

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

36

Multicasting

Registry

Web Service 1

Client Client

Web Service 2

… 1-Request 2-Addresses

Web Service n

3-Broadcast to all

  • Use First response
  • Use Best response
  • Use Subset
slide-10
SLIDE 10

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

37

Bidding

Registry

Web Service 1

Client Client

Web Service 2

… 1-Request 2-Addresses

Web Service n

3-Broadcast

  • r poll

Web Service 1 Web Service 2

Web Service n

4-Iteratively Request to beat best current offer

Web-Based Information Systems University of Alberta

 Dr. Osmar R. Zaïane, 2001-2006

38

Web Services Missing Pieces

  • Security

– Single Sign-on, credentials

  • Transactions
  • Quality of service

– Timeliness guarantees

  • Asynchronous operations

– Co-ordination, workflow