Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian...
-
Upload
maria-mcdougall -
Category
Documents
-
view
216 -
download
0
Transcript of Universität Bonn, Seminar Component Engineering for Media Applications SS 2003, Autor – Sebastian...
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
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)
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>
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
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
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“>
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
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
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)>
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
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
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
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
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
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
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
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 !
Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 19
Historical context
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
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
Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 22
Roles
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
Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 24
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
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 !
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
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 !
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
Universität Bonn, Seminar „Component Engineering for Media Applications“ SS 2003, Autor – Sebastian Lorenz 30
Thanks for your attention