Service Oriented Architecture

wrendeceitInternet και Εφαρμογές Web

21 Οκτ 2013 (πριν από 3 χρόνια και 8 μήνες)

52 εμφανίσεις

Service Oriented Architecture

1

Agenda


Introduction


Service and Service oriented architecture


XML


Formal Methods for Web Services Process Modeling


Automata, Process Algebra and Petri Nets



Web Services


Web Services as middleware


Semantic Web Services


RDF, Description Logic, OWL,
RuleML
, OWL
-
S, WSMO



Conclusions

2

Service and Service Science


Service (from IBM):


A service is a provider/client interaction that creates and


captures value.


Service sector is important in post
-
manufacturing countries


80% of economic activities in US (from National Academy of
Engineering 2003)


70% of the Organization for Economic Cooperation and Development
(OECD) countries



Service Science


An new emerging discipline in business schools


Marketing, customer relation, operations research, business,


macroeconomics

3

Service Computing


The role of Computing in Services


Facilitating the communication, storage, and processing

of information


Decreasing the cost of customization and marketing to small
segments


Giving the customer a broader range of selection



In this tutorial


Automated services enabled by Internet techniques


Communicating among services


Composing services into a process


Semantic
-
based service searching and matching

4

Service Oriented Architecture (SOA)


The OASIS SOA Reference Model group defines
Service Oriented Architecture
is a paradigm for
organizing and utilizing distributed capabilities that may
be under the control of different ownership domains. It
provides a uniform means to offer, discover, interact
with and use capabilities to produce desired effects
consistent with measurable preconditions and
expectations.


Web services is a popular way to realize SOA.

5

Web Service Stack


Process BPEL4WS, WSCI, WS
-
CDL


Discovery UDDI


Description WSDL


XML messaging XML
-
RPC, SOAP, XML


Transport HTTP, SMTP, FTP, BEEP

6

Web Service Process Description
Languages


Orchestration language: BPEL4WS


Choreograph languages: WS
-
CDL, WSCI



Formal models: Process Algebras, Petri nets,


Automata

7

Modeling and Reasoning about Web
Service Processes


How to model the control flow and data flow



What are the reasoning tasks



What are the techniques for these tasks

8

Web Service Process vs. Workflow

Management


Workflow management


Hybrid system of human and software applications


Collaborative working environment


Workitems
-
actors


Process descriptions similar to orchestration languages



Web services


Automated services


Interoperation and service oriented architecture


request
-
response


Web service process engine can be similar to workflow
management engine (cf. Karagiannis 2006)

9

Business Process Execution Language for

Web Service (BPEL4WS)


The information described by BPEL4WS:


The execution order of the activities



The triggering conditions of the activities



The partners for the external activities



The composition of Web Services



The binding to WSDL (activities <
-
> operations)

10

Business Process (what) versus WSDL
(how)


Business Process:
what to do


Modeled as a sequence of activities


Tools aid to define, monitor, and manage business processes


WSDL:
how to execute activities


An activity can be an internal or external Web service
(SOAP/WSDL)


A business process can be exposed for consumption by another
business process or a client application

11

How BPEL looks like?

<process name="
echoString
"

targetNamespace
="
urn:echo:echoService
"

xmlns:tns
="
urn:echo:echoService
"

xmlns
="http://schemas.xmlsoap.org/ws/2003/03/business
-
process/">

<
partnerLinks
>

<
partnerLink

name="caller"

partnerLinkType
="
tns:echoPLT
"

myRole
="service"/>

</
partnerLinks
>

<variables>

<variable name="request"
messageType
="
tns:StringMessageType
"/>

</variables>

<sequence name="
EchoSequence
">

<receive
partnerLink
="caller"
portType
="
tns:echoPT
"

operation="echo" variable="request"

createInstance
="yes" name="
EchoReceive
"/>

<reply
partnerLink
="caller"
portType
="
tns:echoPT
"

operation="echo" variable="request" name="
EchoReply
"/>

</sequence>

</process>

12

BPEL activities


Basic Activities: atomic actions


<receive>


<reply>


<invoke>


<assign>


<throw>


<terminate>


<wait>


<empty>

13

BPEL Structured Activities


<sequence>: an ordered sequence of
activties



<flow>: parallel activities



<switch>: “case
-
statement” approach



<while>: loop



<pick>: execute one of several alternative paths

14

<
faultHandlers
>


In response to faults



Defines the recovery actions when faults occur



To undo the partial and unsuccessful work of a scope in
which a fault has occurred



To do other business logic

15

Control the execution order using <link>


<link> defines dependencies between the activities in
BPEL


Defines the recovery actions when faults occur



To undo the partial and unsuccessful work of a scope in
which a fault has occurred



To do other business logic

16

Data flow: <variable>


Data variables used by activities


<variable
messagetype
=“...”>: WSDL message;


<variable type=“…”>: XML Schema simple type;


<variable element=“…”>: XML Schema element.



Variables associated with message types can be


specified as input or output variables for invoke,


receive and reply activities.

17

Web Service Choreography Interface
(WSCI)


Describes the flow of messages



The observable behaviors of a Web service



No internal behaviors



Compared with WSDL


WSDL does not describe the execution orders of operations


WSDL does not describe the correlation aspects

18

Web Service Choreography Interface
(WSCI)


Atomic Activities


<action> :mapping to an operation in WSDL


<delay>


<empty>


<fault>


<call>


<spawn>


<join>



Complex Activities


<process>


<all>: parallel


<choice>


<
foreach
>


<sequence>


<switch>


<until>


<while>



Variables: map to SOAP messages similar like BPEL

19

Web Service Choreography Description

Language (WS
-
CDL)


A global conversation among services


WSCI is a projection of the entire conversation on a participant



Observable behaviors



Based on Pi
-
Calculus



Elements


Channels


Three structures: sequence, parallel, and choice


Variables

20

ebXML

Business Process Specification

Schema (
ebXML

BPSS)


A choreography language



Between two business partners



Contains more information than Web service process
description languages


Business documents


Business transactions (protocol to exchange documents)


Binary collaborations (composition of transactions)


Multiparty collaborations (2 or more binary collaborations)


Substitution sets

21

Formal Model


A Business Process and BPEL Description


A finite automaton:
A
finite state machine (FSM)

or
finite state automaton

(plural:
automata
) or simply a
state machine

is a model of behavior composed of a
finite number of states, transitions between those states,
and actions.


Petri nets:
it graphically depicts the structure of a
distributed system as a directed bipartite graph with
annotations.


Process Algebra: T
he
process calculi

(or
process
algebras
) are a diverse family of related approaches to
formally
modelling

concurrent systems.

22

Control flow verification


Temporal logic model checking to prove properties of
services:
liveness
, safety, and request
-
response (a request is
always satisfied, also for infinite behaviors). If the property
is not satisfied, a counterexample is returned.



Bisimulation
, to check whether the behaviors of two
services or two versions of the same service are equivalent;
or, if they are different.



Simulation, to check whether the behavior of a service is
included within the behavior of other interacting services.



Execution traces of the service, to understand the behavior
of the service.

23

Data flow verification


data type checking, in the case of LOTOS and other
process algebras allowing data handling.

24

Model
-
based Diagnosis and Monitoring


Find out the Web Services that are responsible for the
failed business process



Determine what kind of information to record for
diagnosis



How to recover from failures

25

Diagnosis with Discrete Event Systems


Model right behavior, as well as faulty behavior



Unfold the execution trajectory based on observations



If a fault action is in the trajectory, this fault occurs



Recovery is a
replanning

task?



Diagnosability

for discrete event system?

26

Reconfiguration


Change business partners or business process at run time



Model the end points in the model



Model the operations to forward the end points?



BPEL has to use the forwarded end points?



Replanning
?

27

Self
-
manageable Web Service Processes


Self
-
management = automatic composition +
verification + fault diagnosis + monitoring +
reconfiguration

28

Web Services


W3C Web Services Architecture:


A Web service is a software system designed to support
interoperable machine
-
to
-
machine interaction over a
network. It has an interface described in a machine
-
processable

format.”


Web services are application components


Web services communicate using open protocols


Web services are self
-
contained and self
-
describing


Web services can be discovered using UDDI


Web services can be used by other applications


XML is the basis for Web services

29

How Does it Work?


The basic Web services platform is XML + HTTP.


The HTTP protocol is the most used Internet protocol.


XML provides a language which can be used between
different platforms and programming languages and still
express complex messages and functions.


Web services platform elements


SOAP (Simple Object Access Protocol)


UDDI (Universal Description, Discovery and Integration)


WSDL (Web Services Description Language)

30

Web Services vs. SOA


Two opinions:


SOA typically refers to Web Services

W3C


Web service
reference architecture is on the foundation of
SOAP
and WSDL


SOA is not the same as Web Services (in this tutorial too)



Web services are an instantiation of SOA with SOAP and
WSDL



SOA is a concept not bound to any specific technology



What people agree


The roles and operations in the SOA/WS triangle


The principles of SOA/WS


There are many ways to implement messaging and service
description language, but ought to use internet protocols

31

SOA/Web Service triangle



.

32

Why Web Services?


Interoperability has highest priority.


Web services take Web applications to the next level.


Web services have two types of uses.


Reusable application components


Connect existing software

33

SOA/WS Principles


Service Encapsulation


Service Loose coupling
-

Services maintain a relationship that minimizes
dependencies and only requires that they maintain an awareness of each other



Service contract
-

Services adhere to a communications agreement, as defined
collectively by one or more service description documents


Service abstraction
-

Beyond what is described in the service contract,
services hide logic from the outside world


Service reusability
-

Logic is divided into services with the intention of
promoting reuse



Service
composability

-

Collections of services can be coordinated and
assembled to form composite services



Service autonomy


Services have control over the logic they encapsulate



Service statelessness


Services minimize retaining information specific to an
activity



Service discoverability


Services are designed to be outwardly descriptive so
that they can be found and assessed via available discovery mechanism

34

General Advantages of XML


XML offers new general possibilities, from which SOA
can profit:


Definition of self
-
describing data in worldwide
standardized, non
-
proprietary format


Structured data and knowledge exchange for enterprises
in various industries


Integration of information from different sources (into
uniform documents)

35

Address Example: HTML to XML


HTML Markup:

<
em
>
Xaver

M.
Linde
</
em
>

<
br
>

Wikingerufer

7

<
br
>

<strong>10555 Berlin</strong>


XML tags are chosen for content
-
structuring needs

<address>

<name>
Xaver

M.
Linde
</name>

<street>
Wikingerufer

7</street>

<town>10555 Berlin</town>

</address>

36

What is SOAP?


SOAP (Simple Object Access Protocol) is a lightweight
protocol for exchange of information in a decentralized,
distributed environment.



XML based protocol binds various internet protocols,
like HTTP, SMTP, FTP, etc.



Interoperability to Web Services

37

SOAP (Simple Object Access Protocol)


SOAP stands for Simple Object Access Protocol


SOAP is a communication protocol


SOAP is for communication between applications


SOAP is a format for sending messages


SOAP is designed to communicate via Internet


SOAP is platform independent


SOAP is language independent


SOAP is based on XML


SOAP is simple and extensible


SOAP allows you to get around firewalls


SOAP will be developed as a W3C standard

38

Why SOAP


inter
-
application communication between systems
written in arbitrary languages, across the Internet.



An XML
-
based protocol for exchanging messages
over
Internet transport protocols, like HTTP,
SMTP, FTP, etc.



SOAP is platform
-
independent.

39

SOAP Building Blocks


A SOAP message is an ordinary XML document
containing the following elements:


A required Envelope element that identifies the XML document
as a SOAP message


An optional Header element that contains header information


A required Body element that contains call and response
information


An optional Fault element that provides information about
errors that occurred while processing the message


40

Syntax Rules of SOAP


A SOAP message MUST be encoded using XML


A SOAP message MUST use the SOAP Envelope
namespace


A SOAP message MUST use the SOAP Encoding
namespace


A SOAP message must NOT contain a DTD reference


A SOAP message must NOT contain XML Processing
Instructions

41

Skeleton SOAP Message


<?xml version="1.0"?> <
soap:Envelope

xmlns:soap
="http://www.w3.org/2001/12/soap
-
envelope"
soap:encodingStyle
="http://www.w3.org/2001/12/soap
-
encoding">

<
soap:Header
> ... ... </
soap:Header
>

<
soap:Body
>

... ...

<
soap:Fault
>

</
soap:Fault
>

</
soap:Body
>

</
soap:Envelope
>

42

What is WSDL?


WSDL is an XML
-
based language for describing Web
services and how to access them.


WSDL stands for Web Services Description Language


WSDL is written in XML


WSDL is an XML document


WSDL is used to describe Web services


WSDL is also used to locate Web services


WSDL is not yet a W3C standard


43

WSDL Functions


A contract between requestor and provider



Platform and language
-
independent



Describe SOAP services



Automatic tool to generate client and sever code

44

WSDL: Describe a web service


Interface information describing all publicly available
functions



Data type information for all message requests and
message responses



Binding information about the transport protocol to be
used



Address information for locating the specified services

45

The WSDL Document Structure


A WSDL document describes a web service using these
major elements:


Element

Defines

<
portType
>

The operations performed by the web service

<message>

The messages used by the web service

<types>

The data types used by the web service

<binding>

The communication protocols used by the web
service

46

WSDL Example

<message name="
getTermRequest
">

<part name="term" type="
xs:string
"/>

</message>

<message name="
getTermResponse
">

<part name="value" type="
xs:string
"/>

</message>

<
portType

name="
glossaryTerms
">

<operation name="
getTerm
">

<input message="
getTermRequest
"/>

<output message="
getTermResponse
"/>

</operation>

</
portType
>

47

Web Services vs.
Middlewares

Web

Service

RMI

CORBA

DCOM

Transport

Protocol

HTTP

JRMP

IIOP

ORPC

Data Binding

XML
Schema

Primitive,
serialized
objects

IDL

MS IDL

Compliant
Programming
Languages

Any

Java

Any

Many (C++,
Java, VB,
etc.)

48

Web Services vs.
Middlewares

Web

Service

RMI

CORBA

DCOM

Interface

Description

WSDL

Interface

of
server objects

IDL

ORPC

Remote
Call

SOAP

Get
references of
server objects

Get
references of
server objects



Get

Pointer of

server

objects

Routine

Stub
Proxy

DII

Client:

stub or
proxy

Sever:
skeleton

Client:

stub or
proxy

Sever:
skeleton

Client:

proxy

Sever: stub

49

What is UDDI?


UDDI is a directory service where businesses can
register and search for Web services.


UDDI stands for Universal Description, Discovery and
Integration


UDDI is a directory for storing information about web
services


UDDI is a directory of web service interfaces described
by WSDL


UDDI communicates via SOAP

50

Web Service Discovery


Three Approaches


The registry approach



The index approach



The peer
-
to
-
peer approach


UDDI: Universal Description, Discovery, and
Integration


White pages



Yellow pages



Green pages

51

Web Service Discovery


Three Approaches


The registry approach



The index approach



The peer
-
to
-
peer approach


UDDI: Universal Description, Discovery, and
Integration


White pages



Yellow pages



Green pages

52

White pages


Information on a business itself


Locations of the business


Contact names


Unique identifiers, e.g. tax IDs


URL



Associated with <
businessEntity
> element

53

Yellow pages


Categorized information about the services provided by
a business.



Categorization: assigning one or more taxonomies to
the business


E.g. a service is categorized as an “online store” and as an
“Music Store”



Associated with <
businessService
> element

54

Green pages


Technical information about a service which is offered
by a business.


Service location (URL)


Category


Specification of the service



Associated with <
businessService
> and
<
bindingTemplate
> elements

55

Implementation Phase of
ebXML


Look up industry profile


Download industry profile


Adapt own system


Register CPP

56

ebXML

components


Business documents:


Core components



Business transactions



Trade partner agreements


CPP


CAP



Business registration

57

Semantic Web Services


Extend the Web with Semantics and Computation



Dubbed here Web++, joinable with Web 2.0

58