universität bonn, seminar component engineering for media applications ss 2003, autor – sebastian...

30
Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 1 Web Services

Upload: maria-mcdougall

Post on 26-Mar-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 1

Web Services

Page 2: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 2

Contents

Base technologies XML SOAP

Web Services

WSDL

UDDI

Page 3: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 3

XML

EXTENSIBLE MARKUP LANGUAGE

Derived from SGML extremely simple dialect of SGML Metalanguage Text-based markup language

Designed to describe data Fast becoming standard for data interchange on the web

Standardized W3C Recommendation, 6 October 2000 : Extensible Markup

Language (XML) 1.0 (Second Edition)

Page 4: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 4

XML Example

<?xml version="1.0"?>

<message>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</message>

<?xml version="1.0"?>

<message>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</message>

Page 5: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 5

XML Document Structure

XML and HTML Similar syntax but Designed for different purposes

HTML : display data XML : describe data

XML document Contains XML elements

XML element Start tag (with optional attributes) Content End Tag

XML tags Not predefined

Page 6: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 6

XML Syntax

Rules XML document MUST contain a root element XML elements MUST be properly nested Attribute values MUST be quoted XML tags MUST have a closing tag XML tags are case sensitive

Well formed XML XML document without breach of these rules More precisely : according to the W3C recommendation

Page 7: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 7

XML Namespaces

Namespace Method to avoid element name conflicts

Use of a prefix

Uniform Resource Identifier (URI) Unique name I.e. Uniform Resource Locator (URL)

xmlns attribute XMLs way to define namespaces Placed in the start tag of an element

All child elements with same prefix are associated with same namespace

Syntax : General Namespace: <element xmlns:namespace-prefix=„namespace“> Default Namespace: <element xmlns=„namespace“>

Page 8: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 8

XML Validation

Document Type Definition (DTD) or XML-Schema (XSD) Agreement necessary for data interchange Different ways to define legal building blocks and document

structure Express shared vocabularies

Valid XML document Well Formed Conforms to the rules of a DTD or XML-Schema

Page 9: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 9

Document Type Definition (DTD)

Defined as part of the XML specification

Two ways of usage Internal External

Different Syntax than XML Can‘t be processed with standard XML Parser

Not hierarchical Can‘t specify complex relationships No context-sensitivity

Page 10: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 10

DTD Example

<?xml version="1.0"?>

<!DOCTYPE msg[<!ELEMENTmsg(to,from,heading,body)> <!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT subject (#PCDATA)><!ELEMENT text (#PCDATA)> ]> <msg>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</msg>

<?xml version="1.0"?>

<!DOCTYPE msg[<!ELEMENTmsg(to,from,heading,body)> <!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT subject (#PCDATA)><!ELEMENT text (#PCDATA)> ]> <msg>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</msg>

Internal DOCTYPE declaration External DOCTYPE declaration

<?xml version="1.0"?>

<!DOCTYPE message SYSTEM „msg.dtd">

<msg>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</msg>

<?xml version="1.0"?>

<!DOCTYPE message SYSTEM „msg.dtd">

<msg>   

<to>[email protected]</to> <from>[email protected]</from> <subject>...</subject>

<text> ...   </text>

</msg>

<!ELEMENTmsg(to,from,heading,body)> <!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT subject (#PCDATA)><!ELEMENT text (#PCDATA)>

<!ELEMENTmsg(to,from,heading,body)> <!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT subject (#PCDATA)><!ELEMENT text (#PCDATA)>

Page 11: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 11

XML-Schema Definition (XSD)

Written in XML Inherits XML‘s Advantages

Simplicity Extensibility

Specify any kind of relationship Support of Data Types

Validation of the corectness of data is easier Facilitates work with a database Own datatypes can be created

Namespaces Standardized

W3C Recommendation, 2 May 2001

Page 12: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 12

Manipulating XML documents

Tree-based APIs XML document is mapped in internal tree structure E.g. DOM (random access mode)

Document Object Model

Event-based APIs Parsing events are reported to application SAX

Simple API for XML

Page 13: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 13

The benefits of XML

Universal data format

Plain text Files can be easily created and edited Platform independency Reusability

Hierarchical Faster access Increased efficiency

Page 14: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 14

SOAP

Simple Object Access Protocol XML-based Intended for decentralized, distributed environments

Information exchange HTTP Enables Remote Procedure Calls (RPCs) using HTTP Enables document-oriented messaging

Standardized W3C Recommendation 24 June 2003 : SOAP Version 1.2

Page 15: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 15

SOAP Building Blocks

Required Envelope element

Identifies document as a SOAP-message Framework for packaging message information <soap:Envelope xmlns:soap=”http://www.w3.org/2003/05/soap-envelope”>

Body element Contains call and response information

Optional Header element

Additional application-specific information

Fault element Information about errors that ocurred while processing the message

Page 16: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 16

SOAP Building Blocks Example

1 <?xml version="1.0"?>2 <soap:Envelope3 xmlns:soap="http://www.w3.org/2003/05/soap-envelope"4 soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">5 <soap:Header>6 ... 7 </soap:Header>8 <soap:Body>9 ...10 <soap:Fault>11 ...12 </soap:Fault>13 </soap:Body>14 </soap:Envelope>

specific information about the SOAP message

error message from a SOAP message

Page 17: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 17

SOAP HTTP Binding

HTTP Communication Over TCP/IP HTTP Client connects to HTTP Server After established connection, client can send HTTP request

HTTP POST or HTTP GET

Server processes request and sends HTTP response back

HTTP POST Content-Type

MIME Type for the message Character encoding

Content-Length in bytes

POST /item HTTP/1.1Host: 189.123.345.239 Content-Type: text/plain Content-Length: 200

POST /item HTTP/1.1Host: 189.123.345.239 Content-Type: text/plain Content-Length: 200

200 OKContent-Type: text/plainContent-Length: 200

200 OKContent-Type: text/plainContent-Length: 200

Request

Response

Page 18: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 18

Web Service

Service Abstract set of functionality Programmable component

Accessible over the internet through XML messaging

Simplicity and ubiquity The Internets‘ success factors Basic principles of Web Services

Still under development !

Page 19: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 19

Historical context

Page 20: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 20

Web Service Committees

W3C World Wide Web Consortium http://www.w3c.org

OASIS Organisation for the Advancement of Structured Information

Standards http://www.oasis-open.org

WS-I Web Services Interoperability Organisation http://www.ws-i.org

Webservices.org

Page 21: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 21

Web Service Characteristics

Interoperability Platform & language independent

Automate processes Program to program / business to business (B2B) interaction

Loosely coupled system More flexible reconfiguration

Page 22: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 22

Roles

Page 23: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 23

Web Services Architecture

W3C Working Draft 14 May, 2003 : Web Services Architecture Abstract framework

Programming Stack Concrete implementation Collection of standardised protocols and application programming

interfaces (APIs) UDDI : Universal Description, Discovery and Integration Service WSDL : Web Services Description Language SOAP : Simple Object Access Protocol HTTP : Hypertext Transport Protocol

Page 24: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 24

Page 25: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 25

Development

J2EE Industry standard SUN ONE

Java Web Services Developer Pack (JWSDP)

IBM Websphere etc.

.NET Mircosoft

Page 26: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 26

WSDL

Web Services Description Language

Description of a Web Service Details about operations Location

Based on XML

Not yet a W3C standard !

Page 27: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 27

WSDL Service definition

Six major elements :

<types> <message> <portType> <binding> <port> <service>

Example : http://soap.amazon.com/schemas/AmazonWebServices.wsdl

Page 28: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 28

UDDI

Universal Description, Discovery and Integration of Web Services

Specification

Implementation Implemented on common XML format Provides Registry Access : SOAP

No formal relationship between WSDL and UDDI !

Page 29: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 29

Final Example

DollarRent-A-Car

SouthwestAirlines

Internet Booking

UNIXWINDOWS

Web Service

Architecture

Page 30: Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian Lorenz 1 Web Services

Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 30

Thanks for your attention