Presentation is loading. Please wait.

Presentation is loading. Please wait.

Www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti-innsbruck.at Semantic Web Services Web Service Technologies Lecture IV – 26 th March 2009 Dieter.

Similar presentations


Presentation on theme: "Www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti-innsbruck.at Semantic Web Services Web Service Technologies Lecture IV – 26 th March 2009 Dieter."— Presentation transcript:

1 www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti-innsbruck.at Semantic Web Services Web Service Technologies Lecture IV – 26 th March 2009 Dieter Fensel slides from Jacek Kopecký

2 www.sti-innsbruck.at 2 #DateTitle 15 th MarchIntroduction 212 th MarchWeb Science 319 th MarchService Science 426 th MarchWeb Services (WSDL, SOAP, UDDI, XML) 52 nd AprilWeb 2.0 and RESTful services 623 rd AprilWSMO 730 th AprilWSML 87 th MayWSMX 914 th MayOWL-S and others 1028 th MayWSMO-Lite, MicroWSMO 114 th JuneSWS Use Cases 1218 th Juneseekda: the business point of view 1325 th JuneMobile services 142 nd JulyExam Preparation Where are we?

3 www.sti-innsbruck.at 3 Overview Motivation Technical solutions –SOAP protocol and related specs –WSDL interface definition language –Further selected specfications

4 www.sti-innsbruck.at 4 Motivation

5 www.sti-innsbruck.at 5 Motivation: SOA Service-Oriented Architecture For large-scale distributed computing For interoperability within and among enterprises Business-oriented services –Coarse-grained service interfaces –Improves evolvability, manageability Needs a suitable set of technologies

6 www.sti-innsbruck.at 6 Web Services Technology for SOA Client-server messaging approach –With predefined Message exchange patterns –Independent of network protocols Application-specific interfaces –Similar to RPC, CORBA Most data in XML –Descriptions in XML Schema

7 www.sti-innsbruck.at 7 RPC vs. Web Services Remote Procedure Calls Aim to hide the network –Distributed system looks like a local system –Some calls happen to go over the network But network is important –Latency, bandwidth –Reliability – connection, nodes RPC is harmful

8 www.sti-innsbruck.at 8 CORBA vs Web Services CORBA = Distributed Objects –Encourages fine-grained design Much more advanced than RPC High barrier to entry –Caused by binary protocols, high core complexity Initial big interoperability problems –Due to the above, and incomplete specifications

9 www.sti-innsbruck.at 9 Technical Solution: WS-* registry client service (provider) publish descriptions discover services invoke

10 www.sti-innsbruck.at 10 SOAP

11 www.sti-innsbruck.at 11 SOAP in Detail: Overview née Simple Object Access Protocol –In fact, simple messaging protocol Current version: 1.2 @ W3C Message structure Processing model Protocol bindings

12 www.sti-innsbruck.at 12 SOAP Messages XML Envelope Body –Application payload –Faults Headers –Metadata, processing instructions –May be marked as mandatory –Possibly targeted at intermediaries

13 www.sti-innsbruck.at 13 SOAP Message Example unique ID endpoint data

14 www.sti-innsbruck.at 14 Body SOAP Message Envelope Header

15 www.sti-innsbruck.at 15 SOAP Processing Model Processing a message 1.Selecting headers targeted at me –The current intermediary or ultimate receiver 2.Checking for understanding –Do I understand all that is targeted at me and marked as mandatory? 3.Processing everything in some order

16 www.sti-innsbruck.at 16 SOAP Mandatory Headers mustUnderstand="true" –The recipient must understand them –Implies agreement to act in accordance to the spec –Non-mandatory headers can be ignored This mechanism enables gracious evolution –If a new feature can be ignored, its introduction won't harm older nodes –If a new feature must be understood, its introduction will be discovered early by older nodes, without unexpected behavior

17 www.sti-innsbruck.at 17 SOAP Protocol Bindings Transporting the message over a network Addressing –What an endpoint address looks like Serialization –How to put the XML message in on-the-wire bits and bytes Connection –How to send the bits to the endpoint

18 www.sti-innsbruck.at 18 SOAP HTTP Binding Addressing: URIs Serialization: HTTP message body –Media type application/soap+xml Connection: TCP Possibly Web-friendly –SOAP 1.1 only used HTTP POST

19 www.sti-innsbruck.at 19 SOAP MEPs Message Exchange Patterns Request-Response –Input message followed by output or fault SOAP-Response –Request without SOAP (e.g. HTTP GET) –SOAP output or fault

20 www.sti-innsbruck.at 20 SOAP Summary Still pretty simple even if the name doesn’t say so any more Extremely extensible HTTP binding for easy communication The value of SOAP: XML and Processing Model

21 www.sti-innsbruck.at 21 Attachments XML is nice, but… not binary XOP: XML-binary Optimized Packaging –Binary data in XML logically in the tree –On serialization, it is outside, raw, efficient MIME multipart message MTOM: XOP for SOAP –Message Transfer Optimization Mechanism –Extends SOAP HTTP binding

22 www.sti-innsbruck.at 22 WS-Addressing Simple routing protocol Endpoint References for addressing –With parameters or metadata in addition to the service address Message headers for routing & correlation –Many headers use endpoint references

23 www.sti-innsbruck.at 23 WSA Msg Info Headers To – let the middleware deliver the message From, ReplyTo, FaultTo – channels back MessageID, RelatesTo – simple correlation Action – semantics implied by the message unique ID endpoint address URI

24 www.sti-innsbruck.at 24 Web Service Description Language WSDL

25 www.sti-innsbruck.at 25 WSDL in Detail: Overview Web Service Description Language –Interface Definition Language (IDL) for Web Services Current version: 2.0 @ W3C –Version 1.1 still in widespread use Interface – reusable, abstract –Operations with MEPs Binding – reusable, concrete Service implements an interface –Endpoints use bindings

26 www.sti-innsbruck.at 26 service WSDL Component Structure service

27 www.sti-innsbruck.at 27 service WSDL Component Structure service endpoint

28 www.sti-innsbruck.at 28 service WSDL Component Structure service endpoint interface

29 www.sti-innsbruck.at 29 service WSDL Component Structure service endpoint interface fault operation fault

30 www.sti-innsbruck.at 30 service WSDL Component Structure service endpoint interface fault operation fault interface binding

31 www.sti-innsbruck.at 31 service WSDL Component Structure service endpoint interface fault operation fault interface binding fault operation fault

32 www.sti-innsbruck.at 32 WSDL Component Structure interface fault operation fault

33 www.sti-innsbruck.at 33 WSDL Component Structure interface fault operation fault msg ref message ref msg ref fault ref

34 www.sti-innsbruck.at 34 WSDL Component Structure interface fault operation fault msg ref message ref msg ref fault ref types

35 www.sti-innsbruck.at 35 WSDL Component Structure interface fault operation fault msg ref message ref msg ref fault ref types fault operation element declaration type definition

36 www.sti-innsbruck.at 36 WSDL Component Structure interface fault operation fault msg ref message ref msg ref fault ref types fault operation element declaration type definition

37 www.sti-innsbruck.at 37 WSDL Interface Design of application interface –Possibly extending other interfaces Operations –Message exchange pattern (MEP) –Input/output messages, faults –Referencing XML elements defined in types Faults –Used and reused by operations

38 www.sti-innsbruck.at 38 WSDL Interface Example <operation name=“transfer” pattern=“http://www.w3.org/2004/08/wsdl/in-out”> <operation name=“balance” safe=“true” pattern=“http://www.w3.org/2004/08/wsdl/in-out”> <fault name=“InvalidBankAccount” element=“InvalidAccountInfo” /> <fault name=“InsufficientFunds” element=“InsufficentFundsInfo” />

39 www.sti-innsbruck.at 39 WSDL Predefined MEPs Invocation: In-only In-out Out-only Out-in Messaging: Robust in-only In-optional-out Robust out-only Out-optional-in core additional, not formal standard

40 www.sti-innsbruck.at 40 WSDL Invocation MEPs In-only: a single input message –No faults In-out: a single input message, a single output message –A fault may replace output message Out-only and Out-in mirror images of the above

41 www.sti-innsbruck.at 41 WSDL Messaging MEPs Robust in-only: a single input message –May trigger a fault In-optional-out: a single input message, possibly an output message –Either message may trigger a fault Robust out-only, Out-optional-in mirrored

42 www.sti-innsbruck.at 42 WSDL Binding Networking details necessary for accessing the service Copies interface structure SOAP and HTTP bindings provided

43 www.sti-innsbruck.at 43 WSDL Bindings SOAP binding: –XML message in SOAP envelope –Transport using a SOAP protocol binding (HTTP) HTTP binding: –Web-friendly –XML message in payload, or as parameters in the URI

44 www.sti-innsbruck.at 44 WSDL Service A logical node of the application One interface Multiple alternate endpoints Endpoints may have different bindings –E.g. SOAP over HTTP for a public endpoint, and SOAP over JMS for the intranet

45 www.sti-innsbruck.at 45 WSDL Service Example <service name=“HypoTirol” interface=“Banking”> <endpoint name=“visible” binding=“HTTP” address=“http://ht.at/bankingSvc” /> <endpoint name=“tls” binding=“SecureHTTP” address=“https://ht.at/bankingSvc” />

46 www.sti-innsbruck.at 46 WSDL Summary Concrete service Abstract and reusable Interface Network binding WSDL does not imply implementation –CORBA IDL requires objects Exchange of XML business documents Extensible in many ways

47 www.sti-innsbruck.at 47 And More WS-* Specifications

48 www.sti-innsbruck.at 48 UDDI Universal Description, Discovery and Integration A Web service registry API specification –Business-oriented service publication, discovery (initially limited search capabilities) –Itself has Web service interface –Useful for intranet registries A failed public service

49 www.sti-innsbruck.at 49 UDDI Structure Business entity –Organization information, contact Business Service –A group of related services Binding Template –Information on how to access the service tModel (technical model) –Any kind of specification, e.g. WSDL –Also for classification, categorization

50 www.sti-innsbruck.at 50 WS Policy Non-functional metadata –Security, Quality of service, Privacy, Transactionality policies Policy a set of alternatives (OR) –Auth tokens: Kerberos OR X509 Alternative a set of assertions (AND) –Auth token AND secure channel Assertions come from 3 rd parties

51 www.sti-innsbruck.at 51 WS Policy Example wsse:Kerberosv5TGT wsse:X509v3

52 www.sti-innsbruck.at 52 The Rest of the Specs Security: authentication, encryption Reliable messaging –“Get the message there or tell me” Transactions: ACID, Compensating BPEL4WS: Scripting Web Services Interoperability: WS-I Basic Profile … and still more

53 www.sti-innsbruck.at 53 Specification Origins Ad-hoc industry alliances –Usually including Microsoft, IBM Standardization bodies –W3C (Web-oriented), OASIS (industrial) –Only when an initial specification is mature Standardization takes time, requires consensus/compromise

54 www.sti-innsbruck.at 54 Illustration by Example

55 www.sti-innsbruck.at 55 Virtual Travel Agency

56 www.sti-innsbruck.at 56 Blue Hotel WSDL (1) <description xmlns="http://www.w3.org/ns/wsdl" targetNamespace= "http://www.bluehotel.com/wsdl/BlueHotelService" xmlns:tns= "http://www.bluehotel.com/wsdl/BlueHotelService" xmlns:bhns= "http://www.bluehotel.com/schemas/BlueHotelService" xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdlx= "http://www.w3.org/ns/wsdl-extensions"> This document describes the Blue Hotel Web service.

57 www.sti-innsbruck.at 57 Blue Hotel WSDL (2) <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.bluehotel.com/schemas/BlueHotelService" xmlns="http://www.bluehotel.com/schemas/BlueHotelService"> <xs:element name="checkAvailabilityResponse" type="tCheckAvailabilityResponse"/>

58 www.sti-innsbruck.at 58 Blue Hotel WSDL (3) <fault name = "invalidDataFault" element = "bhns:invalidDataError"/> <operation name="opCheckAvailability" pattern="http://www.w3.org/ns/wsdl/in-out" style="http://www.w3.org/ns/wsdl/style/iri" wsdlx:safe = "true"> <input messageLabel="In" element="bhns:checkAvailability" /> <output messageLabel="Out" element="bhns:checkAvailabilityResponse" />

59 www.sti-innsbruck.at 59 Blue Hotel WSDL (4) <binding name="BlueServiceSOAPBinding" interface="tns:BlueServiceInterface" wsoap:protocol= "http://www.w3.org/2003/05/soap/bindings/HTTP/" type="http://www.w3.org/ns/wsdl/soap"> <fault ref="tns:invalidDataFault" wsoap:code="soap:Sender"/> <operation ref="tns:opCheckAvailability" wsoap:mep= "http://www.w3.org/2003/05/soap/mep/soap-response"/> <service name="BlueService" interface="tns:BlueServiceInterface"> <endpoint name="reservationEndpoint" binding="tns:BlueServiceSOAPBinding" address="http://www.bluehotel.com/BlueService"/>

60 www.sti-innsbruck.at 60 Blue Hotel UDDI Binding Template <bindingTemplate bindingKey= "uuid:36F1B765-BDB3-4837-828D-8284301E5A2A" serviceKey= "uuid:40E6D5A8-3E16-4f01-99DA-035229685A40"> SOAP binding for Blue Hotel service http://www.bluehotel.com/hotel:80/soap <tModelInstanceInfo tModelKey= "uuid:AE1B645F-CF2F-491f-811A-4868705F5904"/>

61 www.sti-innsbruck.at 61 Blue Hotel UDDI tModel <tModel tModelKey= "uddi:WE1B6Q5F-CF2F-491f-811A-4868705F5904" operator="http://www.bluehotel.com/hotel" authorizedName="George Blue"> BlueHotelInterface Port Type An interface for the Blue Hotel service http://www.bluehotel.com/services/ BlueHotelService.wsdl

62 www.sti-innsbruck.at 62 Blue Hotel SOAP Request POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <soap:Envelope soap:encodingStyle= "http://www.w3.org/2001/12/soap-encoding" xmlns:soap="http://www.w3.org/2001/12/soap-envelope"> <soap:Body xmlns:bhns= "http://www.bluehotel.com/wsdl/BlueHotelService"> 2009-03-24 2009-03-30 Single

63 www.sti-innsbruck.at 63 Blue Hotel SOAP Response HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <soap:Envelope soap:encodingStyle= "http://www.w3.org/2001/12/soap-encoding" xmlns:soap="http://www.w3.org/2001/12/soap-envelope"> <soap:Body xmlns:bhns= "http://www.bluehotel.com/wsdl/BlueHotelService"> Single Discount 150.50

64 www.sti-innsbruck.at 64 Conclusions

65 www.sti-innsbruck.at 65 Web Services Summary Technology for service-oriented systems Core: protocol + IDL (SOAP + WSDL) Many extension specifications Messaging paradigm –Sometimes RPC Biggest benefit: XML –Vendor-neutral, platform-independent –Interoperable –Easy to begin and play with –But hidden in the frameworks Unless you're a developer of the framework

66 www.sti-innsbruck.at 66 Further Developments Semantic Web Services –Automating the use of Web services –Using semantic technologies RESTful services –Real Web services –Integrated with the Web

67 www.sti-innsbruck.at 67 References SOAP: http://w3.org/TR/soap12http://w3.org/TR/soap12 WSDL: http://w3.org/TR/wsdl20http://w3.org/TR/wsdl20 XOP: http://w3.org/TR/xop10http://w3.org/TR/xop10 MTOM: http://w3.org/TR/soap12-mtomhttp://w3.org/TR/soap12-mtom WS-Addressing: http://w3.org/TR/ws-addr-corehttp://w3.org/TR/ws-addr-core WS-Policy:http://w3.org/TR/ws-policyhttp://w3.org/TR/ws-policy UDDI: http://uddi.xml.org/http://uddi.xml.org/ OASIS: http://oasis-open.org/http://oasis-open.org/ W3C: http://w3.org/http://w3.org/ Wikipedia:http://en.wikipedia.org/wiki/Web_Serviceshttp://en.wikipedia.org/wiki/Web_Services

68 www.sti-innsbruck.at 68 #DateTitle 15 th MarchIntroduction 212 th MarchWeb Science 319 th MarchService Science 426 th MarchWeb Services (WSDL. SOAP, UDDI, XML) 52 nd AprilWeb 2.0 and RESTful services 623 rd AprilWSMO 730 th AprilWSML 87 th MayWSMX 914 th MayOWL-S and others 1028 th MayWSMO-Lite, MicroWSMO 114 th JuneSWS Use Cases 1218 th Juneseekda: the business point of view 1325 th JuneMobile services 142 nd JulyExam Preparation Next Lecture

69 www.sti-innsbruck.at 69 Questions?


Download ppt "Www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti-innsbruck.at Semantic Web Services Web Service Technologies Lecture IV – 26 th March 2009 Dieter."

Similar presentations


Ads by Google