View
109
Download
0
Category
Preview:
Citation preview
1
Michael Kleinkleinm@ipd.uni-karlsruhe.de
http://www.michaelklein.net/nki
Verlesung“Informationssysteme: Neuere Konzepte”
Web Services
2 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 2
Übungsblätter
Zunächst: Besprechung der 3 Übungsblätter
3
Michael Kleinkleinm@ipd.uni-karlsruhe.de
http://www.michaelklein.net/nki
Verlesung“Informationssysteme: Neuere Konzepte”
Web Services
(Folien teilweise auf englisch)
4 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 4
Szenario (1)
Telefon-anschluss?
Telefongesellschaft
Auftrag
5 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 5
Szenario (2)Tele
fongese
llsch
aft
Auftrag
Reservierung der Nummer
Eintrag Telefonbuch
Einkauf Endgeräte
Versand Endgeräte
Eintrag?
Einzug Anschlussgebühr
en
Anschlussverfügbar?
ja
nein
nein
ja
ok
Entschuldigungs-schreiben
Prob
Geschäftsprozess
6 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 6
Dienstorientierte Architektur
Geschäftsprozess
Funktionalität A
Dienst-geber 1
Funktionalität A
Dienst-geber 2
Funktionalität A
Dienst-geber 3
Funktionalität A‘
Dienst-geber 5
Funktionalität B‘
Nutzung von Funktionalität externer Entitäten über Dienste
Funktionalität kann evtl. kostengünstig ausgelagert werden.
7 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 7
Service Oriented Computing
Network not as collection of documents but as a collection of functionality
Applications and business processes use functionality of other entities
especially interesting: in mobile networks with limited capabilities in the internet: large companies, many services outsourcing
Integration of distributed functionality across organizational and network boundaries
8 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 8
Characteristics of SOC
Characteristics Functionality is hidden behind an interface
Offered functionality is publicly described
Service = public functionality that can be published, discovered, and executed across the network(client-server paradigm)
9 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 9
General Process: the „Service Triangle“
Repository
Requestor(Client)
Provider(Server)
1. describe offer
2. publish
3. describe request
4. search For
5. match
6. select7. configure
8. invoke 9. execute
10. transfer results
10 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 10
Service Description Language
ServiceRequests
ServiceRequests
Service Provider
ServiceProvider
ServiceProvider
ServiceProvider
ServiceProvider
ServiceDesc
ServiceDesc
ServiceDesc
ServiceDesc
ServiceDesc
?Which provider is appropriate? (matching)How to invoke it? (binding, configuration)
11
Web Services
WSDL, SOAP, UDDI
12 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 12
What is a Web Service?
Web Service
Web Service = service that Accessible through the internet consumes and produces xml documents is uniquely identified by an uri Based on three main technologies
WSDL: Web Service Description Language SOAP: Simple Object Access Protocoll UDDI: Universal Description, Discovery and Integration
xml xml
13 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 13
Task of the Technologies
Repository
Requestor(Client)
Provider(Server)
1. describe offer
2. publish
3. describe request
4. search For
5. match
6. select7. configure
8. invoke 9. execute
10. transfer results
WSDLWSDL
UDDI
SOAP
automatic prematching based on categories manual matching and selecting static binding
14 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 14
WSDL, SOAP, and UDDI
WSDL to describe the functionality of a service helps to find an appropriate service helps to invoke a found service correctly
UDDI directory service is itself a service helps to get an overview of the services in the repository only helpful in case of very many services
SOAP communication protocol between service requestor and provider helps to transfer simple (atomic) and complex (composite) data
All based on XML
15 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 15
Web Service Stack
Communication
Description Discovery
TCP/IP
HTTP
XML
SOAP
XML
WSDL
WSDL Extensions
UDDI
Semantics
Task: provide a standard, flexible communications channel
Task: provide a standard, flexible way to describe what and how a Web service does what it does.
Task: provide a standard, flexible way to discover where a Web service is located .
XML
16
WSDL
Building Blocks
17 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 17
History of WSDL
NASSL SDL/SCL …
2000: Microsoft, IBM and Ariba jointly issue WSDL 1.0
2001: A dozen companies submit WSDL 1.1 as W3C Note
2002: W3C publishes WSDL 1.2 as Working Draft
2003: WSDL is separated into three parts: core, messages, bindings
2004: WSDL 2.0 (mainly renamings)
18 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 18
WSDL 1.2 Components as UML Diagram
service = publiclycallable functionality
operation = function thatprocesses an input
messageand returns an output message
message = collection ofinformation that can be exchanged via network
CONCRETE
ABSTRACTservice
port
0..*
port type
operation message
part
0..*
0..*
input
output
fault
0..1
0..1
0..1
*
*
*
* 1binding1*has has
element : type
19 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 19
Types
defines important datatypes primitive types from XML schema complex types buildable via <complexType>-Tag
<types> <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name="TradePriceRequest"> <complexType> <all> <element name="tickerSymbol" type="string"/> </all> </complexType> </element> <element name="TradePrice"> <complexType> <all> <element name="price" type="float"/> </all> </complexType> </element> </schema> </types>
20 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 20
Messages
<message name="GetLastTradePriceInput"> <part name="body" element="xsd1:TradePriceRequest"/> </message> <message name="GetLastTradePriceOutput"> <part name="body" element="xsd1:TradePrice"/> </message>
combines types to abstract messages smallest interchangeable units unidirectional built up from parts
21 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 21
Operation and PortType
<portType name= "StockQuotePortType"> <operation name = "GetLastTradePrice"> <input message = "tns:GetLastTradePriceInput"/> <output message = "tns:GetLastTradePriceOutput"/> </operation></portType>
Operation is abstract functionality that receives an input messages processes it send set an output
and fault messages
PortType groups operations to interfaces
22 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 22
Operation Types
One-way operationsinput only
Request-Responseinput, then output(default)
Solicit-Responseoutput, then input
Notificationoutput only
client server
client server
client server
client server
23 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 23
Binding
Connects abstract PortTypes with concrete Ports Defines concrete message syntax Defines concrete communication protocol details Most important protocol: SOAP Simpler protocols like
HTTP GET/POST possible
<binding name="StockQuoteBinding„ type="tns:StockQuotePortType"> <soap:binding style= "document" transport= "http://schemas.xmlsoap.org/soap/http"/> <operation name= "GetLastTradePrice"> <soap:operation soapAction=“http://example.com/GetLastTradePrice"/> <input> <soap:body use= "literal"/> </input> <output> <soap:body use= "literal"/> </output> </operation> </soap:binding></binding>
24 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 24
Port and Service
Port specifies a concrete address of a binding Service is a collection of such ports
<service name="StockQuoteService"> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/> </port></service>
25 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 25
Components of WSDL 1.2 – Summary
CONCRETE
ABSTRACTservice
port
0..*
port type
operation message
part
0..*
0..*
input
output
fault
0..1
0..1
0..1
*
*
*
* 1binding1*has has
element : type
26 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 26
Renamings in WSDL 2.0
Port
PortType
Message
Part
WSDL 1.2 WSDL 2.0
Endpoint
Interface
no special tag. Directly definedby xs:element and xs:complexType
no special tag. Directly definedby xs:sequence and xs:element
27 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 27
Example for Changes in WSDL 2.0
<types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema“
targetNamespace="http://…/schemas/resSvc.xsd“>
<xs:element name="checkAvailability“ type="tCheckAvailability"/> <xs:complexType name="tCheckAvailability"> <xs:sequence> <xs:element name="checkInDate" type="xs:date"/> <xs:element name="checkOutDate" type="xs:date"/> <xs:element name="roomType" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:element name="checkAvailabilityResponse" type="xs:double"/> <xs:element name="invalidDataError" type="xs:string"/> </xs:schema> </types>
Message
Part
28
WSDL
Discovery
29 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 29
Matching
Task: Given a service description for a requested service r and a
service description of an offered service o. Question: Is o suitable to fulfill r’s needs? To what degree?
Idea: Matcher compares o and r and calculates matching value in [0,1] 0.0: o is not suitable at all 1.0: o is perfectly suitable intermediate values: o is suitable to the given degree
30 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 30
Matching WSDL Descriptions – Approaches
(1) Keyword based Search Request r is set of keywords. Matching value is only a hint Manual postprocessing and selection necessary
(2) Type based Matchers Check whether input message of request „provides more“
information than input message of offer Check whether output message of request „wants less“
information than output message of offer
„wants less“ each type in the request has to appear in the offer types of the offer have to be a subtype of the desired types in the
request
31 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 31
Type based Matcher
Service
ir_1
…ir_n
or_1
…or_m
Service
io_1
…io_k
oo_1
…oo_l
Request r Offer o
For each or_i in r: Is there a oo_j in o with oo_j subtypeof or_i
For each io_i in o: Is there a ir_j in r with ir_j subtypeof io_i
32 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 32
Problems with WSDL Matching
Service
incomingmessages
outgoingmessages
Message oriented service description
Problems Not really new. Already in CORBA, DCOM, EJB, ebXML, …
No advantage to pure interface description
Semantics not clearFunctionality has to be guessed from flow of information What does a service, that requests a String and outputs an Integer? automatic selection difficult
Strict message compatibilityIf messages between provider and requestor do not match, the service cannot be used
33
WSDL
Tools and Extensions
34 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 34
Tools for WSDL
Integration in Programming Languages Microsoft .NET Sun: Java Web Service Development Pack
XML Processing, SOAP Binding, XML Registry… Web Services Toolkit (WSTK) von IBM Plugins for Eclipse (WSDL Viewer, WSDL Validator, …) SOAP for Perl NuSOAP – SOAP Toolkit for PHP …
Tools / Server Components for WSDL Axis (SOAP Server) IBM’s Websphere Graphical WSDL editors like CapeClear WSDL generators (“right-click on method”) WSDL validators …
35 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 35
WSDL in Practice – Early Adopters
amazon.com “Amazon E-Commerce Service” Everything but really buy:
ItemLookup, ItemSearch, SimilarityLookup CartAdd, CartClear, CartCreate, CartGet, CartModify
Service requestors need to registers first Intended usage: including Amazon in own web sites
ebay.com “eBay SOAP API” Offer Items, Place Bids, Search for articles…
google.com
36 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 36
WS-*: Language Extension for WSDL
WS-PolicyFor including non-functional requirements/assertions in WSDL descriptions
WS-Resource Framework (WSRF)For describing resources and states on the service provider.
WS-Security (WSS)For securing the usage of web services
WS-CoordinationFor enhancing WSDL descriptions by protocols to coordinate the actions of several participants. Example: WS-AtomicTransaction
37 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 37
Web Service Composition – BPEL4WS
servicerequestor
serviceprovider
subprovider 1
subprovider 2
subprovider 3
WSDL BPEL4WS
BPEL4WS = Business Process Execution Language for Web Services
Specification of the Orchestration, i.e. the coordination between main service and its subservice providers.
Developed by Microsoft (“XLANG”) and IBM (“WSFL”)
38 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 38
Evaluation of WSDL
Advantages Easy to understand Widely accepted Rich tool support good integration in programming languages many extensions important early adopters upcoming standard for description
Disadvantages Low semantics primitive matchers not usable for automatic service selection designed for static service binding
39
Ausblick:
Semantic Web Services
40 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 40
Dienstorientierte Architektur
Geschäftsprozess
Funktionalität A
Dienst-geber 1
Funktionalität A
Dienst-geber 2
Funktionalität A
Dienst-geber 3
Funktionalität A‘
Dienst-geber 5
Funktionalität B‘
Nutzung von Funktionalität externer Entitäten über Dienste
Dynamische Dienstbindung
41 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 41
Dynamic Service Binding
Dynamic Service Binding Advantages
robust context-aware network independent
Most important task: automation Complete process should be automatic
Important: Semantic Service Description Language
42 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 42
Ansätze
ALLGEMEIN:Von syntaktischer zu semantischer Dienstbeschreibung
Einigung auf ein gemeinsames Vokabular Ontologie Nicht mehr Drucker/Printer/prt/lpt1, sondern „PRINTER“
Zusätzlich Beschreibung der Zustandsänderung durch den Dienst Welcher Zustand muss vor Dienstausführung gelten? Welcher Zustand gilt nach erfolgreicher Dienstausführung?
Getrennte Anfrage- und Angebotsbeschreibungen Anfrager kann Präferenzen in die Anfrage integrieren Was muss, was soll, was darf, was könnte etc.
43 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 43
Gemeinsames Vokabular
Grundsätzlicher Ansatz:Rechnerverständlichkeit benötigt gemeinsames Vokabular
Einsatz von Ontologien
Location
Room Buildingwithin
room2.14:Room room335:Room geb50.34:Buildingwithin
Schema
Instanzen
44 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 44
Typen von Dienstbeschreibungen
Dienst
eingehendeNachrichten
abgehende Nachrichten
1. Reinnachrichtenbasierte Dienstbeschreibung(z.B. WSDL)
Dienst
Zustände vor Dienstausführun
g
Zustände nach Dienstausführun
g
2. GetrenntNachrichten-/Zustandsbasierte Dienstbeschreibung(z.B. OWL-S)
Dienst
3. Rein Zustandsorientierte Dienstbeschreibung(z.B. DSD)
konfigurierbare Zustände vor
Dienstausführung
konfigurierbare Zustände nach
Dienstausführung
Zustand
Information
45 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 45
Vorteile
Vorteile eines gemeinsamen Vokabulars: Keine unterschiedliche Benennung des gleichen Sachverhalts Beschreibung ist eindeutig Computer kann Vergleich selbstständig durchführen Allerdings auch Einigungsaufwand
Vorteile von rein zustandsorientierten Beschreibungen: Keine explizite Beschreibung von Nachrichten Einfluss der ausgetauschten Information auf Zustände klar
definiert Dienst können passen, obwohl Informationsfluss
unterschiedlich
46
ZUSAMMENFASSUNG
47 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 47
Zusammenfassung
Dienstorientierte Architektur
WSDLSOAP
UDDI
Semantische Dienstbeschreibung
Dynamische Dienstbindung
Dienstverzeichnis
Web Service
abstrakte vs. konkrete Dienstbeschreibung
Vergleich vonWSDL-Beschreibungen
rein zustandsorientierteDienstbeschreibungBPEL4WS
message-operation-port-service
48 Vorlesung “Informationssysteme: Neuere Konzepte”, Teil I, Michael Klein 48
Thank youfor your attention!
Recommended