Sws lecture4-handouts

STI Innsbruck
STI InnsbruckSTI Innsbruck

Sws lecture4-handouts

4/9/2018
1
1
© Copyright 2010   Dieter Fensel and Srdjan Komazec, updated by Anna Fensel in 2016‐2018
Semantic Web Services
SS 2018
Web services
Anna Fensel
09.04.2018
2
Where are we?
# Title
1 Introduction
2 Web Science + + Cathy O’Neil’s talk: “Weapons of Math Destruction”
3 Service Science
4 Web services
5 Web2.0 services
6 Semantic Web
7 Semantic Web Service Stack (WSMO, WSML, WSMX)
8 OWL-S and the others
9 Semantic Services as a Part of the Future Internet and Big Data Technology
10 Lightweight Annotations
11 Linked Services
12 Applications
13 Mobile Services
4/9/2018
2
3
Outline
• Motivation
• Technical solution
– SOAP protocol and related specifications
– WSDL interface definition language
– Additional related specifications
• Illustration by a larger example
• Possible Extensions
• Summary
• References
4
MOTIVATION
4/9/2018
3
5
Motivation: “What is a Web Service?”
https://www.youtube.com/watch?v=u80uPzhFYvc
6
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
4/9/2018
4
7
Motivation
Solutions needed to implement SOA lifecycle
• SOA is a programming style
• An SOA application is a composition of
services
• A ‘service’ is a building block/unit of an
SOA
• Service encapsulates a business
process
• A Service Provider registers services
• Service consumption involves Find-
Bind-Execute pattern
• Questions
– How to specify data involved in the process?
– How to specify the way to access a service
functionality?
– How to communicate to services?
– Can we use some existing solutions?
Service
Registry
Service
Consumer
Service
Provider
Register
Find
Bind
Execute
SOA Elements
8
Motivation
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
4/9/2018
5
9
Motivation
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
10
Motivation
Why is RPC considered harmful?
• Introduces semantics of a synchronous, blocking invocation
– SOA needs a more flexible implementation technology
• Usage of statically typed interfaces
– Late binding is one of the premises of SOA
• Restrictive, inflexible and does not provide the required level of
abstraction
– Implicit introduction of the behavior which characterizes unified memory space
solutions
• Hinders resolution of the interoperability issues
– Harder to adapt
• An appropriate SOA underlying technology needs to shift from the
single-machine-centric vision towards the network-centric vision
4/9/2018
6
11
Motivation
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
12
TECHNICAL SOLUTION
WEB SERVICE SPECIFICATION AND PROTOCOL STACK
4/9/2018
7
13
Position in the Communication Architecture:
TCP/IP vs. OSI Model
See: http://www.tcpipguide.com/free/t_TCPIPArchitectureandtheTCPIPModel-2.htm
14
Web Service Stack
Overview
Service Transport
Service Messaging
Service Description
Service Discovery
- Registry of Web Services
- UDDI
- Describes the public interface to a
specific Web Service
- WSDL
- XML-based message encoding
- XML-RPC, SOAP
- Message transportation
- HTTP, SMTP, FTP, BEEP
Web Service Specification and
Protocol Stack
Service‐based Processes - Compositions of Web Services
- WS-BPEL
4/9/2018
8
15
SOAP
Overview
• née Simple Object Access Protocol
– In fact, simple messaging protocol
• Current version: 1.2 @ W3C Recommendation 2007
• Message structure
• Processing model
• Protocol bindings
16
SOAP
Messages
• XML Envelope
• Body
– Application payload
– Faults
• Headers
– Metadata, processing instructions
– May be marked as mandatory
– Possibly targeted at intermediaries
4/9/2018
9
17
SOAP
Message Example
<soap:Envelope namespaces…>
<soap:Header>
<wsa:MessageID> unique ID </wsa:MessageID>
<wsa:ReplyTo> endpoint </wsa:ReplyTo>
</soap:Header>
<soap:Body>
<bank:BalanceRequest>
data
</bank:BalanceRequest>
</soap:Body>
</soap:Envelope>
18
SOAP
Message Envelope
Body
Header
4/9/2018
10
19
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
20
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
4/9/2018
11
21
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
22
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
4/9/2018
12
23
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
24
SOAP
Summary
• Still pretty simple
• Extremely extensible
• HTTP binding for easy communication
• The value of SOAP:
XML and Processing Model
4/9/2018
13
25
SOAP
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
26
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
4/9/2018
14
27
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
<S:Header>
<wsa:MessageID> unique ID </wsa:MessageID>
<wsa:ReplyTo> endpoint </wsa:ReplyTo>
<wsa:To> address </wsa:To>
<wsa:Action> URI </wsa:Action>
</S:Header>
28
WSDL
Overview
• Web Service Description Language
– Interface Definition Language (IDL) for Web Services
• Current version: 2.0 @ W3C Recommendation 2007
– Version 1.1 still in widespread use
• Interface – reusable, abstract
– Operations with MEPs
• Binding – reusable, concrete
• Service implements an interface
– Endpoints use bindings
4/9/2018
15
29
WSDL
Component Structure
service
service
service
30
WSDL
Component Structure
service
service
service
endpoint
endpoint
4/9/2018
16
31
WSDL
Component Structure
service
service
service
endpoint
endpoint
interface
interface
interface
32
WSDL
Component Structure
service
service
service
endpoint
endpoint
interface
interface
interface
fault
fault
operation
operation
operation
fault
4/9/2018
17
33
WSDL
Component Structure
service
service
service
endpoint
endpoint
interface
interface
interface
fault
fault
operation
operation
operation
fault
interface
interface
binding
34
WSDL
Component Structure
service
service
service
endpoint
endpoint
interface
interface
interface
fault
fault
operation
operation
operation
fault
interface
interface
binding
fault
fault
operation
operation
operation
fault
4/9/2018
18
35
WSDL
Component Structure
interface
fault
fault
operation
operation
operation
fault
36
WSDL
Component Structure
interface
fault
fault
operation
operation
operation
fault
msg ref
msg ref
message ref
msg ref
msg ref
fault ref
4/9/2018
19
37
WSDL
Component Structure
interface
fault
fault
operation
operation
operation
fault
msg ref
msg ref
message ref
msg ref
msg ref
fault ref
types
38
WSDL
Component Structure
interface
fault
fault
operation
operation
operation
fault
msg ref
msg ref
message ref
msg ref
msg ref
fault ref
types
fault
fault
operation
operation
element declaration
type definition
4/9/2018
20
39
WSDL
Component Structure
interface
fault
fault
operation
operation
operation
fault
msg ref
msg ref
message ref
msg ref
msg ref
fault ref
types
fault
fault
operation
operation
element declaration
type definition
40
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
4/9/2018
21
41
WSDL
Interface Example
<interface name=“Banking”>
<operation name=“transfer”
pattern=“http://www.w3.org/2004/08/wsdl/in-out”>
<input element=“Transfer”/>
<output element=“Balance”/>
<outfault ref=“InvalidBankAccount”/>
<outfault ref=“InsufficientFunds”/>
</operation>
<operation name=“balance” safe=“true”
pattern=“http://www.w3.org/2004/08/wsdl/in-out”>
<input element=“BalanceRequest”/>
<output element=“Balance”/>
<outfault ref=“InvalidBankAccount”/>
</operation>
<fault name=“InvalidBankAccount”
element=“InvalidAccountInfo” />
<fault name=“InsufficientFunds”
element=“InsufficentFundsInfo” />
</interface>
42
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
4/9/2018
22
43
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
44
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
4/9/2018
23
45
WSDL
Bindings
• Networking details necessary for accessing the
service
• Copies interface structure
• SOAP and HTTP bindings provided
46
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
4/9/2018
24
47
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
48
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” />
</service>
4/9/2018
25
49
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
50
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
4/9/2018
26
51
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
52
WS-Policy
Overview
• Non of the previous solutions is addressing the non-functional
aspects in the context of Web Services
– e.g., a Web Service can be accessed only if a particular security
constrains (like secure channel communication) hold
• WS-Policy is an XML-based set of specifications to advertise and
specify service-related non-functional metadata
– Security, Quality of service, Privacy, Transactional policies
• WS-Policy main specifications
– WS-Policy Framework
• Provides model and syntax to describe and communicate policies
– WS-Policy Assertions
• Defines a common set of policy assertions for Web services
– WS-Policy Attachments
• General-purpose mechanisms for associating such policies with the subjects
to which they apply
• Capability vs. requirement policy
4/9/2018
27
53
WS-Policy
A Policy
• Policy is a collection of policy alternatives (OR)
– Auth tokens: Kerberos OR X509
• Policy alternative is a collection of policy assertions (AND)
– Auth token AND secure channel
• Policy assertions specify
– traditional policies that will ultimately manifest on the wire
(authentication scheme, transport protocol selection), and
– critical to proper service selection and usage (privacy policy, QoS
characteristics).
• Two "operators" (XML tags) are used to make statements about
policy combinations:
– wsp:ExactlyOne - asserts that only one child node must be satisfied.
– wsp:All - asserts that all child nodes must be satisfied.
• The intersection is a new policy that complies with both their
requirements/capabilities
54
WS-Policy
An Example of the Security Policy
<wsp:Policy>
<wsp:ExactlyOne>
<wsse:SecurityToken>
<wsse:TokenType>wsse:Kerberosv5TGT
</wsse:TokenType>
</wsse:SecurityToken>
<wsse:SecurityToken>
<wsse:TokenType>wsse:X509v3
</wsse:TokenType>
</wsse:SecurityToken>
</wsp:ExactlyOne>
</wsp:Policy>
4/9/2018
28
55
WS-BPEL
Overview
• WS-BPEL is an orchestration executable language for specifying
interactions with Web Service
– Defines an interoperable integration model for Web Service-based processes.
– Describes high-level state transition interactions of a process.
• The language supports following basic facilities:
– Message exchanges,
– Property-based message correlation mechanism,
– XML and WSDL typed variables,
– Structured programming-language concepts such as if-then-else, while, sequence,
and flow,
– Scoping system to allow encapsulation of logic with local-variables, fault-,
compensation- and event- handlers,
– Serialized scopes to control concurrent access to variables,
– Language plug-in model which allows expression writing in the language such as
XPath
56
WS-BPEL
WS-BPEL v2.0 MetaModel
Model taken from http://www.ebpml.org
4/9/2018
29
57
WS-BPEL
Main elements
• Process
– Root element for a WS-BPEL process specification
• Variable
– Holding messages that constitute a part of the state of a business process.
• Activity
– Perform the process logic.
– Basic vs. structured activities.
• PartnerLink
– Models peer-to-peer conversational partner relationships.
• Catch
– Scope-based custom fault-handling activities.
• Correlation
– Used to differentiate instances of the business processes.
– The declaration of correlation relies on declarative properties of messages.
• onEvent
– Scope-based concurrent answering to events
– onEvent vs, onAlarm
58
WS-BPEL
An Example
Example figures and WSBPEL specification taken from OASIS standard Web Services Business Process
Execution Language Version 2.0, 11 April 2007
4/9/2018
30
59
WS-BPEL
An Example
<process name="purchaseOrderProcess" targetNamespace=http://example.com/ws-bp/purchase
xmlns=http://docs.oasis-open.org/wsbpel/2.0/process/executable
xmlns:lns="http://manufacturing.org/wsdl/purchase">
<partnerLinks>
<partnerLink name="purchasing” partnerLinkType="lns:invoicingLT” myRole="invoiceRequester"
partnerRole="invoiceService" />
<partnerLink name="shipping" partnerLinkType="lns:shippingLT” myRole="shippingRequester"
partnerRole="shippingService" />
<partnerLink name="scheduling” partnerLinkType="lns:schedulingLT” partnerRole="schedulingService" />
</partnerLinks>
<variables>
<variable name="PO" messageType="lns:POMessage" />
<variable name="Invoice" messageType="lns:InvMessage" />
<variable name="shippingRequest"messageType="lns:shippingRequestMessage" />
<variable name="shippingInfo"messageType="lns:shippingInfoMessage" />
<variable name="shippingSchedule"messageType="lns:scheduleMessage" />
</variables>
<faultHandlers>
<catch faultName="lns:cannotCompleteOrder"faultVariable="POFault"
faultMessageType="lns:orderFaultType”>
<reply partnerLink="purchasing"portType="lns:purchaseOrderPT" operation="sendPurchaseOrder"
variable="POFault" faultName="cannotCompleteOrder" />
</catch>
</faultHandlers>
…
60
WS-BPEL
An Example
…
<sequence>
<receive partnerLink="purchasing" portType="lns:purchaseOrderPT” operation="sendPurchaseOrder"
variable="PO" createInstance="yes”>
</receive>
<flow>
<links>
<link name="ship-to-invoice" />
<link name="ship-to-scheduling" />
</links>
<sequence>
<assign>
<copy>
<from>$PO.customerInfo</from>
<to>$shippingRequest.customerInfo</to>
</copy>
</assign>
<invoke partnerLink="shipping" portType="lns:shippingPT" operation="requestShipping"
inputVariable="shippingRequest" outputVariable="shippingInfo">
<sources>
<source linkName="ship-to-invoice" /> </sources>
</invoke>
<receive partnerLink="shipping” portType="lns:shippingCallbackPT" operation="sendSchedule"
variable="shippingSchedule”>
<sources>
<source linkName="ship-to-scheduling" />
</sources>
</receive>
</sequence>
…
4/9/2018
31
61
WS-BPEL
An Example
…
<sequence>
<invoke partnerLink="invoicing” portType="lns:computePricePT"
operation="initiatePriceCalculation” inputVariable="PO”>
</invoke>
<invoke partnerLink="invoicing" portType="lns:computePricePT" operation="sendShippingPrice"
inputVariable="shippingInfo”>
<targets><target linkName="ship-to-invoice" /></targets>
</invoke>
<receive partnerLink="invoicing” portType="lns:invoiceCallbackPT” operation="sendInvoice"
variable="Invoice" />
</sequence>
<sequence>
<invoke partnerLink="scheduling” portType="lns:schedulingPT”
operation="requestProductionScheduling” inputVariable="PO">
</invoke>
<invoke partnerLink="scheduling” portType="lns:schedulingPT” operation="sendShippingSchedule”
inputVariable="shippingSchedule”>
<targets><target linkName="ship-to-scheduling" /></targets>
</invoke>
</sequence>
</flow>
<reply partnerLink="purchasing" portType="lns:purchaseOrderPT” operation=”sendPurchaseOrder"
variable="Invoice”>
</reply>
</sequence>
</process>
62
The Rest of the Specs
• Security: authentication, encryption
• Reliable messaging
– “Get the message there or tell me”
• Transactions: ACID, Compensating
• WS-BPEL: Scripting Web Services
• Interoperability: WS-I Basic Profile
• … and still more
4/9/2018
32
63
ILLUSTRATION BY A LARGER
EXAMPLE
64
Virtual Travel Agency
4/9/2018
33
65
Blue Hotel WSDL (1)
<?xml version="1.0" encoding="utf-8" ?>
<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">
<documentation>
This document describes the Blue Hotel Web service.
</documentation>
66
Blue Hotel WSDL (2)
<types>
<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="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="tCheckAvailabilityResponse"/>
<xs:complexType name="tCheckAvailabilityResponse">
<xs:sequence>
<xs:element name="roomType" type="xs:string"/>
<xs:element name="rateType" type="xs:string"/>
<xs:element name="rate" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:element name="invalidDataError" type="xs:string"/>
</xs:schema>
</types>
4/9/2018
34
67
Blue Hotel WSDL (3)
<interface name = "BlueServiceInterface" >
<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" />
<outfault ref="tns:invalidDataFault" messageLabel="Out"/>
</operation>
</interface>
68
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"/>
</binding>
<service name="BlueService"
interface="tns:BlueServiceInterface">
<endpoint name="reservationEndpoint"
binding="tns:BlueServiceSOAPBinding"
address="http://www.bluehotel.com/BlueService"/>
</service>
</description>
4/9/2018
35
69
Blue Hotel UDDI Binding Template
<bindingTemplate
bindingKey=
"uuid:36F1B765-BDB3-4837-828D-8284301E5A2A"
serviceKey=
"uuid:40E6D5A8-3E16-4f01-99DA-035229685A40">
<description xml:lang="en">
SOAP binding for Blue Hotel service
</description>
<accessPoint URLType="http">
http://www.bluehotel.com/hotel:80/soap
</accessPoint>
<tModelInstanceDetails>
<tModelInstanceInfo tModelKey=
"uuid:AE1B645F-CF2F-491f-811A-4868705F5904"/>
</tModelInstanceDetails>
</bindingTemplate>
70
Blue Hotel UDDI tModel
<tModel tModelKey=
"uddi:WE1B6Q5F-CF2F-491f-811A-4868705F5904"
operator="http://www.bluehotel.com/hotel"
authorizedName="George Blue">
<name>BlueHotelInterface Port Type</name>
<description>
An interface for the Blue Hotel service
</description>
<overviewDoc><overviewURL>
http://www.bluehotel.com/services/
BlueHotelService.wsdl
</overviewURL></overviewDoc>
</tModel>
4/9/2018
36
71
Blue Hotel SOAP Request
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<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">
<bhns:checkAvailability>
<bhns:checkInDate>2009-03-24</bhns:checkInDate>
<bhns:checkOutDate>2009-03-30</bhns:checkOutDate>
<bhns:roomType>Single</bhns:roomType>
</bhns:checkAvailability>
</soap:Body>
</soap:Envelope>
72
Blue Hotel SOAP Response
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<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">
<bhns:checkAvailabilityResponse>
<bhns:roomType>Single</bhns:roomType>
<bhns:rateType>Discount</bhns:rateType>
<bhns:rate>150.50</bhns:rate>
</bhns:checkAvailabilityResponse>
</soap:Body>
</soap:Envelope>
4/9/2018
37
73
SUMMARY
74
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
4/9/2018
38
75
Possible Extensions
• Semantic Web Services, Linked Services
– Automating the use of Web services
– Using semantic technologies
• RESTful services
– Real Web services
– Integrated with the Web
• Microservices
– Small services
– Domain-driven design and virtualisation
76
References
• Mandatory reading:
– G. Alonso, F. Casati, H. Kuno, V. Machiraju, 2004.
Web Services, Concepts Architectures and
Applications. Springer Verlag ISBN 3-540-44008-9.
– WSDL http://w3.org/TR/wsdl20
– SOAP http://w3.org/TR/soap12
– UDDI http://uddi.xml.org/
4/9/2018
39
77
References
• Further reading:
– O’Reilly books: 2002 2007 2015
– XOP http://w3.org/TR/xop10
– MTOM http://w3.org/TR/soap12-mtom
– WS-Addressing http://w3.org/TR/ws-addr-core
– WS-Policy http://w3.org/TR/ws-policy
– WS-BPEL http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html
– OASIS http://oasis-open.org/
– W3C http://w3.org/
78
References
• Wikipedia links:
– http://en.wikipedia.org/wiki/Web_Services
– http://en.wikipedia.org/wiki/Web_Services_Description_Language
– http://en.wikipedia.org/wiki/SOAP
– http://en.wikipedia.org/wiki/Universal_Description_Discovery_and_Integratio
n
– http://en.wikipedia.org/wiki/Business_Process_Execution_Language
– http://en.wikipedia.org/wiki/WS-Addressing
– http://en.wikipedia.org/wiki/XML-binary_Optimized_Packaging
– http://en.wikipedia.org/wiki/WS-Policy
– http://en.wikipedia.org/wiki/Web_services_protocol_stack
• YouTube links (SOAP, WSDL, etc. implementation in Eclipse):
– https://www.youtube.com/watch?v=mKjvKPlb1rA&list=PLqq-
6Pq4lTTZTYpk_1DOowOGWJMIH5T39 (SOAP Web Service Basics at
Java Brains channel)
4/9/2018
40
79
Next Lecture
# Title
1 Introduction
2 Web Science + + Cathy O’Neil’s talk: “Weapons of Math Destruction”
3 Service Science
4 Web services
5 Web2.0 services
6 Semantic Web
7 Semantic Web Service Stack (WSMO, WSML, WSMX)
8 OWL-S and the others
9 Semantic Services as a Part of the Future Internet and Big Data Technology
10 Lightweight Annotations
11 Linked Services
12 Applications
13 Mobile Services
80
Questions?

Recommended

Sws lecture4Sws lecture4
Sws lecture4STI Innsbruck
66 views80 slides
Sws lecture8Sws lecture8
Sws lecture8STI Innsbruck
83 views68 slides
Sws lecture10Sws lecture10
Sws lecture10STI Innsbruck
62 views86 slides

More Related Content

What's hot

Sws lecture12Sws lecture12
Sws lecture12STI Innsbruck
66 views96 slides
Sws lecture2Sws lecture2
Sws lecture2STI Innsbruck
67 views106 slides
Sws lecture13Sws lecture13
Sws lecture13STI Innsbruck
66 views62 slides

What's hot(14)

Sws lecture6-handoutsSws lecture6-handouts
Sws lecture6-handouts
STI Innsbruck95 views
Sws lecture10-handoutsSws lecture10-handouts
Sws lecture10-handouts
STI Innsbruck85 views
Sws lecture12Sws lecture12
Sws lecture12
STI Innsbruck66 views
Sws lecture2Sws lecture2
Sws lecture2
STI Innsbruck67 views
Sws lecture13Sws lecture13
Sws lecture13
STI Innsbruck66 views
Sws lecture11-handoutsSws lecture11-handouts
Sws lecture11-handouts
STI Innsbruck74 views
Sws lecture11Sws lecture11
Sws lecture11
STI Innsbruck56 views
Sws 13-mobile servicesSws 13-mobile services
Sws 13-mobile services
STI Innsbruck65 views
Sws lecture2-handoutsSws lecture2-handouts
Sws lecture2-handouts
STI Innsbruck97 views
Sws lecture5-handoutsSws lecture5-handouts
Sws lecture5-handouts
STI Innsbruck109 views
Sws lecture9-handoutsSws lecture9-handouts
Sws lecture9-handouts
STI Innsbruck85 views
Sws lecture7-handoutsSws lecture7-handouts
Sws lecture7-handouts
STI Innsbruck102 views
Sws lecture12-handoutsSws lecture12-handouts
Sws lecture12-handouts
STI Innsbruck74 views

Similar to Sws lecture4-handouts(20)

Sws 04-web servicesSws 04-web services
Sws 04-web services
STI Innsbruck60 views
Ws 05-basic webservicestechnologyWs 05-basic webservicestechnology
Ws 05-basic webservicestechnology
STI Innsbruck86 views
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
Dong Ngoc2K views
WebWeb
Web
Mayank Vora556 views
oracle ebs free web service integration toolsoracle ebs free web service integration tools
oracle ebs free web service integration tools
SmartDog Services5.1K views
Web Services Foundation TechnologiesWeb Services Foundation Technologies
Web Services Foundation Technologies
Pankaj Saharan488 views
REST - Why, When and How? at AMIS25REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25
Jon Petter Hjulstad1.1K views
Hdfs 2016-hadoop-summit-san-jose-v4Hdfs 2016-hadoop-summit-san-jose-v4
Hdfs 2016-hadoop-summit-san-jose-v4
Chris Nauroth1.8K views
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
Rajkattamuri2.6K views
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
Shahid Shaik365 views
L20 ScalabilityL20 Scalability
L20 Scalability
Ólafur Andri Ragnarsson651 views
Sws lecture10-handoutsSws lecture10-handouts
Sws lecture10-handouts
STI Innsbruck83 views
www | HTTP | HTML - Tutorialwww | HTTP | HTML - Tutorial
www | HTTP | HTML - Tutorial
MSA Technosoft206 views
WebServicesWebServices
WebServices
Rajkattamuri331 views

More from STI Innsbruck

Lecture5aLecture5a
Lecture5aSTI Innsbruck
135 views49 slides
Lecture5Lecture5
Lecture5STI Innsbruck
72 views27 slides
Lecture4aLecture4a
Lecture4aSTI Innsbruck
87 views15 slides
Lecture4Lecture4
Lecture4STI Innsbruck
67 views21 slides
Lecture3Lecture3
Lecture3STI Innsbruck
71 views47 slides
Lecture2Lecture2
Lecture2STI Innsbruck
57 views26 slides

More from STI Innsbruck(20)

Lecture5aLecture5a
Lecture5a
STI Innsbruck135 views
Lecture5Lecture5
Lecture5
STI Innsbruck72 views
Lecture4aLecture4a
Lecture4a
STI Innsbruck87 views
Lecture4Lecture4
Lecture4
STI Innsbruck67 views
Lecture3Lecture3
Lecture3
STI Innsbruck71 views
Lecture2Lecture2
Lecture2
STI Innsbruck57 views
Lecture1Lecture1
Lecture1
STI Innsbruck55 views
01 introduction01 introduction
01 introduction
STI Innsbruck196 views
10  -web_mashups10  -web_mashups
10 -web_mashups
STI Innsbruck86 views
09  -web_technologies_iii09  -web_technologies_iii
09 -web_technologies_iii
STI Innsbruck77 views
08  -web_technologies_ii08  -web_technologies_ii
08 -web_technologies_ii
STI Innsbruck66 views
07  -web_technologies_i07  -web_technologies_i
07 -web_technologies_i
STI Innsbruck85 views
06 testing and-usability_on_the_web06 testing and-usability_on_the_web
06 testing and-usability_on_the_web
STI Innsbruck68 views
05 web architectures05 web architectures
05 web architectures
STI Innsbruck79 views
04b design review04b design review
04b design review
STI Innsbruck68 views
03 web modeling03 web modeling
03 web modeling
STI Innsbruck277 views
02 requirements02 requirements
02 requirements
STI Innsbruck71 views
Sws exercise12Sws exercise12
Sws exercise12
STI Innsbruck15 views

Recently uploaded(20)

Sociology KS5Sociology KS5
Sociology KS5
WestHatch52 views
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar87 views
ACTIVITY BOOK key water sports.pptxACTIVITY BOOK key water sports.pptx
ACTIVITY BOOK key water sports.pptx
Mar Caston Palacio275 views
Psychology KS4Psychology KS4
Psychology KS4
WestHatch54 views
Universe revised.pdfUniverse revised.pdf
Universe revised.pdf
DrHafizKosar88 views
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN76 views
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
MysoreMuleSoftMeetup84 views
discussion post.pdfdiscussion post.pdf
discussion post.pdf
jessemercerail85 views
Plastic waste.pdfPlastic waste.pdf
Plastic waste.pdf
alqaseedae94 views
Streaming Quiz 2023.pdfStreaming Quiz 2023.pdf
Streaming Quiz 2023.pdf
Quiz Club NITW97 views
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plans
TARIQ KHAN189 views
2022 CAPE Merit List 2023 2022 CAPE Merit List 2023
2022 CAPE Merit List 2023
Caribbean Examinations Council3.5K views
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Debapriya Chakraborty479 views
STERILITY TEST.pptxSTERILITY TEST.pptx
STERILITY TEST.pptx
Anupkumar Sharma107 views

Sws lecture4-handouts

  • 1. 4/9/2018 1 1 © Copyright 2010   Dieter Fensel and Srdjan Komazec, updated by Anna Fensel in 2016‐2018 Semantic Web Services SS 2018 Web services Anna Fensel 09.04.2018 2 Where are we? # Title 1 Introduction 2 Web Science + + Cathy O’Neil’s talk: “Weapons of Math Destruction” 3 Service Science 4 Web services 5 Web2.0 services 6 Semantic Web 7 Semantic Web Service Stack (WSMO, WSML, WSMX) 8 OWL-S and the others 9 Semantic Services as a Part of the Future Internet and Big Data Technology 10 Lightweight Annotations 11 Linked Services 12 Applications 13 Mobile Services
  • 2. 4/9/2018 2 3 Outline • Motivation • Technical solution – SOAP protocol and related specifications – WSDL interface definition language – Additional related specifications • Illustration by a larger example • Possible Extensions • Summary • References 4 MOTIVATION
  • 3. 4/9/2018 3 5 Motivation: “What is a Web Service?” https://www.youtube.com/watch?v=u80uPzhFYvc 6 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
  • 4. 4/9/2018 4 7 Motivation Solutions needed to implement SOA lifecycle • SOA is a programming style • An SOA application is a composition of services • A ‘service’ is a building block/unit of an SOA • Service encapsulates a business process • A Service Provider registers services • Service consumption involves Find- Bind-Execute pattern • Questions – How to specify data involved in the process? – How to specify the way to access a service functionality? – How to communicate to services? – Can we use some existing solutions? Service Registry Service Consumer Service Provider Register Find Bind Execute SOA Elements 8 Motivation 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
  • 5. 4/9/2018 5 9 Motivation 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 10 Motivation Why is RPC considered harmful? • Introduces semantics of a synchronous, blocking invocation – SOA needs a more flexible implementation technology • Usage of statically typed interfaces – Late binding is one of the premises of SOA • Restrictive, inflexible and does not provide the required level of abstraction – Implicit introduction of the behavior which characterizes unified memory space solutions • Hinders resolution of the interoperability issues – Harder to adapt • An appropriate SOA underlying technology needs to shift from the single-machine-centric vision towards the network-centric vision
  • 6. 4/9/2018 6 11 Motivation 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 12 TECHNICAL SOLUTION WEB SERVICE SPECIFICATION AND PROTOCOL STACK
  • 7. 4/9/2018 7 13 Position in the Communication Architecture: TCP/IP vs. OSI Model See: http://www.tcpipguide.com/free/t_TCPIPArchitectureandtheTCPIPModel-2.htm 14 Web Service Stack Overview Service Transport Service Messaging Service Description Service Discovery - Registry of Web Services - UDDI - Describes the public interface to a specific Web Service - WSDL - XML-based message encoding - XML-RPC, SOAP - Message transportation - HTTP, SMTP, FTP, BEEP Web Service Specification and Protocol Stack Service‐based Processes - Compositions of Web Services - WS-BPEL
  • 8. 4/9/2018 8 15 SOAP Overview • née Simple Object Access Protocol – In fact, simple messaging protocol • Current version: 1.2 @ W3C Recommendation 2007 • Message structure • Processing model • Protocol bindings 16 SOAP Messages • XML Envelope • Body – Application payload – Faults • Headers – Metadata, processing instructions – May be marked as mandatory – Possibly targeted at intermediaries
  • 9. 4/9/2018 9 17 SOAP Message Example <soap:Envelope namespaces…> <soap:Header> <wsa:MessageID> unique ID </wsa:MessageID> <wsa:ReplyTo> endpoint </wsa:ReplyTo> </soap:Header> <soap:Body> <bank:BalanceRequest> data </bank:BalanceRequest> </soap:Body> </soap:Envelope> 18 SOAP Message Envelope Body Header
  • 10. 4/9/2018 10 19 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 20 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
  • 11. 4/9/2018 11 21 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 22 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
  • 12. 4/9/2018 12 23 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 24 SOAP Summary • Still pretty simple • Extremely extensible • HTTP binding for easy communication • The value of SOAP: XML and Processing Model
  • 13. 4/9/2018 13 25 SOAP 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 26 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
  • 14. 4/9/2018 14 27 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 <S:Header> <wsa:MessageID> unique ID </wsa:MessageID> <wsa:ReplyTo> endpoint </wsa:ReplyTo> <wsa:To> address </wsa:To> <wsa:Action> URI </wsa:Action> </S:Header> 28 WSDL Overview • Web Service Description Language – Interface Definition Language (IDL) for Web Services • Current version: 2.0 @ W3C Recommendation 2007 – Version 1.1 still in widespread use • Interface – reusable, abstract – Operations with MEPs • Binding – reusable, concrete • Service implements an interface – Endpoints use bindings
  • 19. 4/9/2018 19 37 WSDL Component Structure interface fault fault operation operation operation fault msg ref msg ref message ref msg ref msg ref fault ref types 38 WSDL Component Structure interface fault fault operation operation operation fault msg ref msg ref message ref msg ref msg ref fault ref types fault fault operation operation element declaration type definition
  • 20. 4/9/2018 20 39 WSDL Component Structure interface fault fault operation operation operation fault msg ref msg ref message ref msg ref msg ref fault ref types fault fault operation operation element declaration type definition 40 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
  • 21. 4/9/2018 21 41 WSDL Interface Example <interface name=“Banking”> <operation name=“transfer” pattern=“http://www.w3.org/2004/08/wsdl/in-out”> <input element=“Transfer”/> <output element=“Balance”/> <outfault ref=“InvalidBankAccount”/> <outfault ref=“InsufficientFunds”/> </operation> <operation name=“balance” safe=“true” pattern=“http://www.w3.org/2004/08/wsdl/in-out”> <input element=“BalanceRequest”/> <output element=“Balance”/> <outfault ref=“InvalidBankAccount”/> </operation> <fault name=“InvalidBankAccount” element=“InvalidAccountInfo” /> <fault name=“InsufficientFunds” element=“InsufficentFundsInfo” /> </interface> 42 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
  • 22. 4/9/2018 22 43 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 44 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
  • 23. 4/9/2018 23 45 WSDL Bindings • Networking details necessary for accessing the service • Copies interface structure • SOAP and HTTP bindings provided 46 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
  • 24. 4/9/2018 24 47 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 48 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” /> </service>
  • 25. 4/9/2018 25 49 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 50 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
  • 26. 4/9/2018 26 51 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 52 WS-Policy Overview • Non of the previous solutions is addressing the non-functional aspects in the context of Web Services – e.g., a Web Service can be accessed only if a particular security constrains (like secure channel communication) hold • WS-Policy is an XML-based set of specifications to advertise and specify service-related non-functional metadata – Security, Quality of service, Privacy, Transactional policies • WS-Policy main specifications – WS-Policy Framework • Provides model and syntax to describe and communicate policies – WS-Policy Assertions • Defines a common set of policy assertions for Web services – WS-Policy Attachments • General-purpose mechanisms for associating such policies with the subjects to which they apply • Capability vs. requirement policy
  • 27. 4/9/2018 27 53 WS-Policy A Policy • Policy is a collection of policy alternatives (OR) – Auth tokens: Kerberos OR X509 • Policy alternative is a collection of policy assertions (AND) – Auth token AND secure channel • Policy assertions specify – traditional policies that will ultimately manifest on the wire (authentication scheme, transport protocol selection), and – critical to proper service selection and usage (privacy policy, QoS characteristics). • Two "operators" (XML tags) are used to make statements about policy combinations: – wsp:ExactlyOne - asserts that only one child node must be satisfied. – wsp:All - asserts that all child nodes must be satisfied. • The intersection is a new policy that complies with both their requirements/capabilities 54 WS-Policy An Example of the Security Policy <wsp:Policy> <wsp:ExactlyOne> <wsse:SecurityToken> <wsse:TokenType>wsse:Kerberosv5TGT </wsse:TokenType> </wsse:SecurityToken> <wsse:SecurityToken> <wsse:TokenType>wsse:X509v3 </wsse:TokenType> </wsse:SecurityToken> </wsp:ExactlyOne> </wsp:Policy>
  • 28. 4/9/2018 28 55 WS-BPEL Overview • WS-BPEL is an orchestration executable language for specifying interactions with Web Service – Defines an interoperable integration model for Web Service-based processes. – Describes high-level state transition interactions of a process. • The language supports following basic facilities: – Message exchanges, – Property-based message correlation mechanism, – XML and WSDL typed variables, – Structured programming-language concepts such as if-then-else, while, sequence, and flow, – Scoping system to allow encapsulation of logic with local-variables, fault-, compensation- and event- handlers, – Serialized scopes to control concurrent access to variables, – Language plug-in model which allows expression writing in the language such as XPath 56 WS-BPEL WS-BPEL v2.0 MetaModel Model taken from http://www.ebpml.org
  • 29. 4/9/2018 29 57 WS-BPEL Main elements • Process – Root element for a WS-BPEL process specification • Variable – Holding messages that constitute a part of the state of a business process. • Activity – Perform the process logic. – Basic vs. structured activities. • PartnerLink – Models peer-to-peer conversational partner relationships. • Catch – Scope-based custom fault-handling activities. • Correlation – Used to differentiate instances of the business processes. – The declaration of correlation relies on declarative properties of messages. • onEvent – Scope-based concurrent answering to events – onEvent vs, onAlarm 58 WS-BPEL An Example Example figures and WSBPEL specification taken from OASIS standard Web Services Business Process Execution Language Version 2.0, 11 April 2007
  • 30. 4/9/2018 30 59 WS-BPEL An Example <process name="purchaseOrderProcess" targetNamespace=http://example.com/ws-bp/purchase xmlns=http://docs.oasis-open.org/wsbpel/2.0/process/executable xmlns:lns="http://manufacturing.org/wsdl/purchase"> <partnerLinks> <partnerLink name="purchasing” partnerLinkType="lns:invoicingLT” myRole="invoiceRequester" partnerRole="invoiceService" /> <partnerLink name="shipping" partnerLinkType="lns:shippingLT” myRole="shippingRequester" partnerRole="shippingService" /> <partnerLink name="scheduling” partnerLinkType="lns:schedulingLT” partnerRole="schedulingService" /> </partnerLinks> <variables> <variable name="PO" messageType="lns:POMessage" /> <variable name="Invoice" messageType="lns:InvMessage" /> <variable name="shippingRequest"messageType="lns:shippingRequestMessage" /> <variable name="shippingInfo"messageType="lns:shippingInfoMessage" /> <variable name="shippingSchedule"messageType="lns:scheduleMessage" /> </variables> <faultHandlers> <catch faultName="lns:cannotCompleteOrder"faultVariable="POFault" faultMessageType="lns:orderFaultType”> <reply partnerLink="purchasing"portType="lns:purchaseOrderPT" operation="sendPurchaseOrder" variable="POFault" faultName="cannotCompleteOrder" /> </catch> </faultHandlers> … 60 WS-BPEL An Example … <sequence> <receive partnerLink="purchasing" portType="lns:purchaseOrderPT” operation="sendPurchaseOrder" variable="PO" createInstance="yes”> </receive> <flow> <links> <link name="ship-to-invoice" /> <link name="ship-to-scheduling" /> </links> <sequence> <assign> <copy> <from>$PO.customerInfo</from> <to>$shippingRequest.customerInfo</to> </copy> </assign> <invoke partnerLink="shipping" portType="lns:shippingPT" operation="requestShipping" inputVariable="shippingRequest" outputVariable="shippingInfo"> <sources> <source linkName="ship-to-invoice" /> </sources> </invoke> <receive partnerLink="shipping” portType="lns:shippingCallbackPT" operation="sendSchedule" variable="shippingSchedule”> <sources> <source linkName="ship-to-scheduling" /> </sources> </receive> </sequence> …
  • 31. 4/9/2018 31 61 WS-BPEL An Example … <sequence> <invoke partnerLink="invoicing” portType="lns:computePricePT" operation="initiatePriceCalculation” inputVariable="PO”> </invoke> <invoke partnerLink="invoicing" portType="lns:computePricePT" operation="sendShippingPrice" inputVariable="shippingInfo”> <targets><target linkName="ship-to-invoice" /></targets> </invoke> <receive partnerLink="invoicing” portType="lns:invoiceCallbackPT” operation="sendInvoice" variable="Invoice" /> </sequence> <sequence> <invoke partnerLink="scheduling” portType="lns:schedulingPT” operation="requestProductionScheduling” inputVariable="PO"> </invoke> <invoke partnerLink="scheduling” portType="lns:schedulingPT” operation="sendShippingSchedule” inputVariable="shippingSchedule”> <targets><target linkName="ship-to-scheduling" /></targets> </invoke> </sequence> </flow> <reply partnerLink="purchasing" portType="lns:purchaseOrderPT” operation=”sendPurchaseOrder" variable="Invoice”> </reply> </sequence> </process> 62 The Rest of the Specs • Security: authentication, encryption • Reliable messaging – “Get the message there or tell me” • Transactions: ACID, Compensating • WS-BPEL: Scripting Web Services • Interoperability: WS-I Basic Profile • … and still more
  • 32. 4/9/2018 32 63 ILLUSTRATION BY A LARGER EXAMPLE 64 Virtual Travel Agency
  • 33. 4/9/2018 33 65 Blue Hotel WSDL (1) <?xml version="1.0" encoding="utf-8" ?> <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"> <documentation> This document describes the Blue Hotel Web service. </documentation> 66 Blue Hotel WSDL (2) <types> <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="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="tCheckAvailabilityResponse"/> <xs:complexType name="tCheckAvailabilityResponse"> <xs:sequence> <xs:element name="roomType" type="xs:string"/> <xs:element name="rateType" type="xs:string"/> <xs:element name="rate" type="xs:double"/> </xs:sequence> </xs:complexType> <xs:element name="invalidDataError" type="xs:string"/> </xs:schema> </types>
  • 34. 4/9/2018 34 67 Blue Hotel WSDL (3) <interface name = "BlueServiceInterface" > <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" /> <outfault ref="tns:invalidDataFault" messageLabel="Out"/> </operation> </interface> 68 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"/> </binding> <service name="BlueService" interface="tns:BlueServiceInterface"> <endpoint name="reservationEndpoint" binding="tns:BlueServiceSOAPBinding" address="http://www.bluehotel.com/BlueService"/> </service> </description>
  • 35. 4/9/2018 35 69 Blue Hotel UDDI Binding Template <bindingTemplate bindingKey= "uuid:36F1B765-BDB3-4837-828D-8284301E5A2A" serviceKey= "uuid:40E6D5A8-3E16-4f01-99DA-035229685A40"> <description xml:lang="en"> SOAP binding for Blue Hotel service </description> <accessPoint URLType="http"> http://www.bluehotel.com/hotel:80/soap </accessPoint> <tModelInstanceDetails> <tModelInstanceInfo tModelKey= "uuid:AE1B645F-CF2F-491f-811A-4868705F5904"/> </tModelInstanceDetails> </bindingTemplate> 70 Blue Hotel UDDI tModel <tModel tModelKey= "uddi:WE1B6Q5F-CF2F-491f-811A-4868705F5904" operator="http://www.bluehotel.com/hotel" authorizedName="George Blue"> <name>BlueHotelInterface Port Type</name> <description> An interface for the Blue Hotel service </description> <overviewDoc><overviewURL> http://www.bluehotel.com/services/ BlueHotelService.wsdl </overviewURL></overviewDoc> </tModel>
  • 36. 4/9/2018 36 71 Blue Hotel SOAP Request POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <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"> <bhns:checkAvailability> <bhns:checkInDate>2009-03-24</bhns:checkInDate> <bhns:checkOutDate>2009-03-30</bhns:checkOutDate> <bhns:roomType>Single</bhns:roomType> </bhns:checkAvailability> </soap:Body> </soap:Envelope> 72 Blue Hotel SOAP Response HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <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"> <bhns:checkAvailabilityResponse> <bhns:roomType>Single</bhns:roomType> <bhns:rateType>Discount</bhns:rateType> <bhns:rate>150.50</bhns:rate> </bhns:checkAvailabilityResponse> </soap:Body> </soap:Envelope>
  • 37. 4/9/2018 37 73 SUMMARY 74 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
  • 38. 4/9/2018 38 75 Possible Extensions • Semantic Web Services, Linked Services – Automating the use of Web services – Using semantic technologies • RESTful services – Real Web services – Integrated with the Web • Microservices – Small services – Domain-driven design and virtualisation 76 References • Mandatory reading: – G. Alonso, F. Casati, H. Kuno, V. Machiraju, 2004. Web Services, Concepts Architectures and Applications. Springer Verlag ISBN 3-540-44008-9. – WSDL http://w3.org/TR/wsdl20 – SOAP http://w3.org/TR/soap12 – UDDI http://uddi.xml.org/
  • 39. 4/9/2018 39 77 References • Further reading: – O’Reilly books: 2002 2007 2015 – XOP http://w3.org/TR/xop10 – MTOM http://w3.org/TR/soap12-mtom – WS-Addressing http://w3.org/TR/ws-addr-core – WS-Policy http://w3.org/TR/ws-policy – WS-BPEL http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html – OASIS http://oasis-open.org/ – W3C http://w3.org/ 78 References • Wikipedia links: – http://en.wikipedia.org/wiki/Web_Services – http://en.wikipedia.org/wiki/Web_Services_Description_Language – http://en.wikipedia.org/wiki/SOAP – http://en.wikipedia.org/wiki/Universal_Description_Discovery_and_Integratio n – http://en.wikipedia.org/wiki/Business_Process_Execution_Language – http://en.wikipedia.org/wiki/WS-Addressing – http://en.wikipedia.org/wiki/XML-binary_Optimized_Packaging – http://en.wikipedia.org/wiki/WS-Policy – http://en.wikipedia.org/wiki/Web_services_protocol_stack • YouTube links (SOAP, WSDL, etc. implementation in Eclipse): – https://www.youtube.com/watch?v=mKjvKPlb1rA&list=PLqq- 6Pq4lTTZTYpk_1DOowOGWJMIH5T39 (SOAP Web Service Basics at Java Brains channel)
  • 40. 4/9/2018 40 79 Next Lecture # Title 1 Introduction 2 Web Science + + Cathy O’Neil’s talk: “Weapons of Math Destruction” 3 Service Science 4 Web services 5 Web2.0 services 6 Semantic Web 7 Semantic Web Service Stack (WSMO, WSML, WSMX) 8 OWL-S and the others 9 Semantic Services as a Part of the Future Internet and Big Data Technology 10 Lightweight Annotations 11 Linked Services 12 Applications 13 Mobile Services 80 Questions?