WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II...

66
WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec 5, 2012 Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 1 / 66

Transcript of WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II...

Page 1: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

WWW Architecture IISoftware Architecture VO/KU (707.023/707.024)

Denis Helic, Roman Kern

KMI, TU Graz

Dec 5, 2012

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 1 / 66

Page 2: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Section

Recap

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 2 / 66

Page 3: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Recap

Open-Closed Principle

All software changes during its life cycle

Programmers face ever changing functional requirements

But need to design software that is stable (i.e. does not change)

Software entities should be open for extension, but closed formodification by B. Meyer

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 3 / 66

Page 4: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Design by contract

Design by contract

Its a contract between a class and its clients (other classes that use it)

Specifies rules that need to be satisfied by the class and by the clients

Preconditions and postconditions for methods , invariants for the class

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 4 / 66

Page 5: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Single Responsibility Principle

Single Responsibility Principle

An entity (an object, a class) should have only a single responsibility

A responsibility is in fact a reason to change

An entity should have only single reason to change

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 5 / 66

Page 6: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

DRY Principle

DRY Principle - Don’t Repeat Yourself

Every piece of knowledge must have a single, unambiguous,authoritative representation within a system

Avoid copy an paste of code

But also applies to other artefacts (e.g. documentation, test files, ...)

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 6 / 66

Page 7: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Law of Demeter

Law of Demeter

A method of an object should only invoke methods of:1 Itself2 Its parameters3 Objects it creates4 Its members

Methods should not invoke methods of other objects’ members

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 7 / 66

Page 8: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Outline

1 Web Services

2 Web Service Architectures

3 Resource Oriented Architectures

4 Service Oriented Architectures

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 8 / 66

Page 9: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Section

Web Services

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 9 / 66

Page 10: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Web as a database

The Web we use is full of data

Book information, opinions, prices, arrival times, blogs, tags, tweets,etc.

The data is organized around a simple data model: node-link model

Each node is a data item that has a unique address and arepresentation

Representation formats are e.g. HTML, PDF,... for humans, or e.gXML, JSON for programs

Nodes can be interlinked using their unique addresses

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 10 / 66

Page 11: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Web as a platform for distributed systems

The Web is full of services that allow humans and programs to usethe Web data

Service also have unique addresses

They use a particular representation for data exchange, e.g. XML,SOAP, WSDL

Services follow a particular architecture that defines how services areused

Programmers combine a number of services to achieve a desiredfunctionality and create a distributed system, e.g. mashups

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 11 / 66

Page 12: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Types of services

What is the Google search engine?

It is a service for querying a massive database (Web search index)

What is a given Web application?

It is a service offering (remotely) a specific functionality

What is a Web site?

It is a service offering specific human consumable information

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 12 / 66

Page 13: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Types of services

All of these services are for users

However, we are interested in services for programmers

Such services provide an API

Programmers use the API, unique addresses, representations ofservices

Programmers follow the arch. style to integrate and combine servicesto achieve a desired functionality

We will call this part of the Web: the programmable Web

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 13 / 66

Page 14: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Kind of Things on the Programmable Web

There are numerous approaches to web services in all areas

The programmable Web is based on HTTP for data transport and inmost cases XML for data representation

However, some services serve HTML, JSON, plain text, binary data,etc.

Also, other things such as addressability or APIs are different

We need a classification!

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 14 / 66

Page 15: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Classification based on architectural design

Which operation should a service execute?

This is method information

What data should be manipulated?

This is scoping information

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 15 / 66

Page 16: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Services

Method information

Question: how the client conveys its intention to the server?

How does a server know a certain request is a request to retrievesome data?

Instead of a request to delete the same data?

Why should the server do this instead of doing that

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 16 / 66

Page 17: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

Section

Web Service Architectures

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 17 / 66

Page 18: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

Competing Architectures

Resource-Oriented Architectures (RESTful)

RPC-Style Architectures (SOA)

REST-RPC Hybrid Architectures

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 18 / 66

Page 19: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

Resource-Oriented Architectures

Resource-Oriented Architectures

Descriptive URLs

URLs reflect the application state

Inherit semantic from HTTP methods

Should be stateless

Limited by its simplicity (limited HTTP methods, ...)

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 19 / 66

Page 20: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

RPC-Style Architectures

RPC - Remote Procedure Call

An RPC style service receives an envelope full of data from the client

The service answers with a similar envelope again full of data to theclient

Both method and scoping information are inside of the envelope

HTTP methods typically POST but sometimes also GET

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 20 / 66

Page 21: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

RPC-Style Architectures

The best example of the envelope format is SOAP

There exist other envelope formats like XML-RPC

Every RPC-style service defines a completely new vocabulary

E.g. the way how method information and scoping information arerepresented

You need another language to define the representation: e.g. WSDL

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 21 / 66

Page 22: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

Problems of RPC-Style Architectures

RPC implies an API

APIs tend to enforce tight coupling of modules and systems

We use declarative XML to describe APIs

This introduces processing overhead

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 22 / 66

Page 23: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Web Service Architectures

REST-RPC Hybrid Architectures

REST-RPC Hybrid Architectures

Inherit parts from REST and RPC style architectures

Used by many Web Site for their API (e.g. Flickr, del.icio.us, ...)

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 23 / 66

Page 24: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Section

Resource Oriented Architectures

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 24 / 66

Page 25: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Resource Oriented Architectures

4 defining features of ROA

Addressability: the scoping information is kept in the URL

Uniform interface: the method information is kept in the HTTPmethod

Statelessness: every HTTP request is isolated from other requests

Connectedness: you link resources into the Web of resources

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 25 / 66

Page 26: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Addressability

Resources are exposed through URLs - an application exposes anumber of URLs

When you have URLs you bookmark, cache responses, chain URLs, ...

Many Web applications do not work this way, i.e. they are notaddressable, e.g. GMail

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 26 / 66

Page 27: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Uniform interface

Standardized HTTP methods: CRUD operations (Create, Retreive,Update & Delete)

Two principles

Safety: GET only reads data

Idempotence: the same operation has the same effect whether youapply it once or multiple times

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 27 / 66

Page 28: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Statelessness

Every request contains all necessary information

There is no state managed on the server side

In fact, there are two kinds of state

You should distinguish between the application state and resourcestate

Application state lives on the client

Resource state lives on the server

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 28 / 66

Page 29: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Statelessness

When you use a search engine your current query and your currentpage belongs to application state

They are different for every client

Resource state is same for every client, i.e. search index

A crawler can update the search index

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 29 / 66

Page 30: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Links and connectedness

Representations of resources, i.e. HTML or XML might have links toother resources

Axiom for ROA services: Hypermedia as the engine of applicationstate

The current application state is not stored on the server as a resourcestate

It is tracked by the client as an application state and created by thepath that client takes through the Web

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 30 / 66

Page 31: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Links and connectedness

For example http://www.google.com/search?q=jellyfish

The first page is the starting application state

You have links to other application states

Obvious for the human Web

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 31 / 66

Page 32: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Links and connectedness

<Buckets>

<Bucket>

<Name>crummy.com</Name>

<URL>https://s3.amazonaws.com/crummy.com</URL>

<CreationDate>...</CreationDate>

</Bucket>

...

</Buckets>

Following the link in the URL element takes the client to a newapplication state

Use links, links, and then use more links, ...

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 32 / 66

Page 33: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Designing ROA

Figure out data set

Split the data set into resources

Then, for each resource

Name the resources with URLs

Expose a subset of the uniform interface

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 33 / 66

Page 34: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Designing ROA

Design representations accepted from the client

Design representations served to the client

Integrate this resource into other resources using links

Consider possible application states

Consider possible error states

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 34 / 66

Page 35: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Example

Application similar google maps: maps of cities, streets, planets,...

Data set: Maps, points, cities, planets, ....

Resources: list of resources, individual resources, results of algorithmsapplied to the data set

Example resources: the list of planets, Mars, Earth, San Francisco,Inffeldgasse, ...

An algorithmic resource: a list of places that match certain criteria -all cities with more than 1 million of people

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 35 / 66

Page 36: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Example

Name the resources: create meaningful URLs

http://maps.example.com/Earth

http://maps.example.com/Earth/France/Paris

http://maps.example.com/Earth/Austria/Cities

http://maps.example.com/Earth/Germany/Cities?pop=1000000

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 36 / 66

Page 37: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Example

Design representations

A representation talks about resource state

A representation links to other (application and resource) states

http://maps.example.com/Earth/Austria →http://maps.example.com/Earth/Austria/Cities

http://maps.example.com/Earth/Austria/Cities →http://maps.example.com/Earth/Austria/Vienna

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 37 / 66

Page 38: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Read/Write ROA systems

User accounts should be resources

To access these resources you need to use HTTP authentication

https://maps.example.com/user/dhelic

Connect with the previous resources: e.g. custom places on a map

https://maps.example.com/user/dhelic/Earth/Graz/Inffeldgasse/office

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 38 / 66

Page 39: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

Method Semantic in ROA systems

The HTTP method implies the semantics

Use GET to retrieve (read the content)

GET https://maps.example.com/user/dhelic

Use PUT to write (modify the content)

PUT https://maps.example.com/user/dhelic

+ Content

Use DELETE to write (remove the resource)

DELETE https://maps.example.com/user/dhelic

⇒ limited to the methods supported by HTTP

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 39 / 66

Page 40: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

REST

REST (Representational State Transfer)

No strict typing

Typically XML as data format

Concepts (RESTful) describes constrains: client-server, stateless,cacheable, layered system, code on demand, uniformity

Nowadays, REST is often used a umbrella terms for relatedarchitectures

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 40 / 66

Page 41: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Resource Oriented Architectures

RESTful frameworks

Ruby on Rails with a plugin

Django in Python

Restlet in Java (http://www.restlet.org/)

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 41 / 66

Page 42: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Section

Service Oriented Architectures -SOA

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 42 / 66

Page 43: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Facts about SOA

SOA is the only thing Chuck Norris can’t kill.

SOA invented the internet, and the internet was invented for SOA.

The first rule of SOA is you do not talk about SOA.

One person successfully described SOA completely, and immediatelydied.

Taken from: http://soafacts.com/

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 43 / 66

Page 44: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Motivation for Services

Loose coupling → separation of service and client

Service has a contract and a schema

Orchestration → a service is part of a bigger system

Reuse by language independent and platform independent protocols

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 44 / 66

Page 45: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Components of SOA

Components of SOA

Services - basic components which provide functionality

Service repository - used for discovery of services

Service bus - interconnect the components of SOA

Workflow engine - often used in SOA to orchestrate services

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 45 / 66

Page 46: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Standards for Web Services

Standards are managed by

The W3C consortiumWS-I, an organisation to promote the interoperability of web services(platform independent, vendor independent)OASIS (The Organization for the Advancement of StructuredInformation Standards)

WSDL (Web Service Description/Definition Language) - XML formatto specify the operations of a service

SOAP (Simple Object Access Protocol) - one-way, stateless protocolto transfer XML data to a single receiver (since SOAP 1.2 there canbe more receivers)

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 46 / 66

Page 47: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Standards for Web Services

Additional standards (of lesser importance)

UDDI (Universal Description, Discovery and Integration) - registryservice for services

SAML (Security Assertion Markup Language) - XML basedframework for user authentication, description of authorization data

XKMS (XML Key Management Specification) - management andregistry of public keys

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 47 / 66

Page 48: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Standards for Web Services

Web Services Standards Overview

innoQ Deutschland GmbH innoQ Schweiz GmbHHalskestraße 17 Gewerbestrasse 11D-40880 Ratingen CH-6330 ChamPhone +49 21 02 77 162-100 Phone +41 41 743 [email protected] · www.innoq.com

This

pos

ter

is n

ot t

o be

repr

oduc

ed o

r tr

ansm

itted

in a

ny f

orm

or

for

any

purp

ose

with

out

the

expr

ess

perm

issi

on o

f in

noQ

Deu

tsch

land

Gm

bH.·

Copy

right

©in

noQ

Deu

tsch

land

Gm

bH. A

ll Ri

ghts

Res

erve

d. T

he p

oste

r m

ay a

lso

cont

ain

refe

renc

es t

o ot

her

com

pany

, org

anis

atio

n, b

rand

and

pro

duct

nam

es. T

hese

com

pany

, org

anis

atio

n, b

rand

and

pro

duct

nam

es a

re u

sed

here

in f

or id

entif

icat

ion

purp

oses

onl

y an

d m

ay b

e th

e tr

adem

arks

of

thei

r re

spec

tive

owne

rs.

InteroperabilityIssues

Metadata Specifications Reliability Specifications

Security Specifications TransactionSpecifications

Messaging Specifications SOAP

Management Specifications PresentationSpecifications

Messaging Specifications

WS-Notification

SOAP Message Transmission Optimization Mechanism

SOAP 1.2

SOAP 1.1

WS-Addressing – Core

WS-Addressing – WSDL Binding

WS-Addressing – SOAP Binding

WS-Topics

WS-BrokeredNotification

WS-Eventing

WS-Enumeration

WS-BaseNotification

Met

adat

a

Secu

rity

Res

ourc

e

Metadata SpecificationsWS-Policy

WS-Discovery

WS-PolicyAttachment

WS-MetadataExchange

Universal Description, Discovery and Integration

Web Service Description Language 1.1

Web Service Description Language 2.0 Core

Web Service Description Language 2.0 SOAP Binding

Mes

sagi

ng

Secu

rity

WS-Security

WS-Security: SOAP Message Security

WS-Security: Kerberos Binding

WS-Security: SAML Token Profile

WS-Security: X.509 Certificate Token Profile

WS-Security: Username Token Profile

WS-SecurityPolicy

WS-Trust

WS-Federation

WS-SecureConversation

Security Specifications

Met

adat

a

Mes

sagi

ng

Rel

iabi

lity

Dependencies

Basic Profile1.1

WS-IFinal Specification

� Basic Profile – The Basic Profile 1.1 providesimplementation guidelines for how related set of non-proprietary Web Service specifications should be usedtogether for best interoperability.

Basic Profile1.2

WS-IWorking Group Draft

� Basic Profile – The Basic Profile 1.2 builds on Basic Profile1.1 by incorporating Basic Profile 1.1 errata, requirementsfrom Simple SOAP Binding Profile 1.0, and adding supportfor WS-Addressing and MTOM.

Basic Profile2.0

WS-IWorking Group Draft

� Basic Profile – The Basic Profile 2.0 is an update of WS-IBP that includes a profile of SOAP 1.2.

Basic Security Profile1.0

WS-IBoard Approval Draft

� Basic Security Profile defines the WS-I Basic SecurityProfile 1.0, based on a set of non-proprietary Web servicesspecifications, along with clarifications and amendmentsto those specifications which promote interoperability.

REL Token Profile1.0

WS-IWorking Group Draft

� REL Token Profile is based on a non-proprietary Web services specification, along with clarifications andamendments to that specification which promoteinteroperability.

SAML Token Profile1.0

WS-IWorking Group Draft

� SAML Token Profile is based on a non-proprietary Web services specification, along with clarifications andamendments to that specification which promoteinteroperability.

Conformance ClaimAttachment Mechanism (CCAM)

1.0WS-I

Final Specification

� Conformance Claim Attachment Mechanism (CCAM)catalogues mechanisms that can be used to attach WS-IProfile Conformance Claims to Web services artefacts(e.g., WSDL descriptions, UDDI registries).

Reliable AsynchronousMessaging Profile (RAMP)

1.0WS-I

Working Draft

� Reliable Asynchronous Messaging Profile (RAMP) is aprofile, in the fashion of the WS-I profiles, that enables,among other things, basic B2B integration scenarios usingWeb services technologies.

� XML – Extensible MarkupLanguage is a pared-downversion of SGML, designedespecially for Webdocuments. It allows one tocreate own customized tags,enabling the definition,transmission, validation, andinterpretation of databetween applications andbetween organizations.

� XML – Extensible Markup Language is a pared-downversion of SGML, designedespecially for Webdocuments. It allows one tocreate own customized tags,enabling the definition,transmission, validation, andinterpretation of databetween applications andbetween organizations.

� Namespaces in XMLprovides a simple methodfor qualifying element andattribute names used in XMLdocuments by associatingthem with namespacesidentified by IRI references.

� XML Information Set is an abstract data set toprovide a consistent set ofdefinitions for use in otherspecifications that need torefer to the information in a well-formed XMLdocument.

� XML Schema – XMLSchema Definition Languageis an XML language fordescribing and constrainingthe content of XMLdocuments.

� XML binary OptimizedPackaging (XOP) is an XMLlanguage for describing andconstraining the content ofXML documents.

WS-Security1.1

OASISOASIS-Standard

WS-Security: Username Token Profile

1.1OASIS

Public Review Draft

� WS-Security is a communications protocol providing ameans for applying security to Web Services.

WS-Security: SOAP Message Security

1.1OASIS

Public Review Draft

� WS-Security: SOAP Message Security describesenhancements to SOAP messaging to provide messageintegrity and confidentiality. Specifically, this specificationprovides support for multiple security token formats, trustdomains, signature formats and encryption technologies.The token formats and semantics for using these aredefined in the associated profile documents.

WS-Security:Kerberos Binding

1.0Microsoft, IBM, OASIS

Working Draft

WS-Security: X.509Certificate Token Profile

1.1OASIS

Public Review Draft

� WS-Security: X.509 Certificate Token Profile describesthe use of the X.509 authentication framework with theWS-Security: SOAP Message Security specification.

� WS-Security: Username Token Profile describes how a Web Service consumer can supply a Username Token as ameans of identifying the requestor by username, andoptionally using a password (or shared secret, etc.) toauthenticate that identity to the Web Service producer.

WS-SecurityPolicy1.1

IBM, Microsoft, RSA Security, VeriSign

Public Draft

� WS-SecurityPolicy defines how to describe policies related to various features defined in the WS-Security specification.

WS-TrustBEA Systems, Computer Associates, IBM, Layer 7

Technologies, Microsoft, Netegrity, Oblix,OpenNetwork, Ping Identity Corporation,

Reactivity, RSA Security, VeriSign and WestbridgeTechnology · Initial Draft

WS-Security: SAML Token Profile

1.1OASIS

Public Review Draft

� WS-Security: SAML Token Profile defines the use ofSecurity Assertion Markup Language (SAML) v1.1 assertionsin the context of WSS: SOAP Message Security includingfor the purpose of securing SOAP messages and SOAPmessage exchanges.

WS-Federation1.0

IBM, Microsoft, BEA Systems, RSA Security, and VeriSign

Initial Draft

� WS-Federation describes how to manage and broker thetrust relationships in a heterogeneous federatedenvironment including support for federated identities.

WS-SecureConversationBEA Systems, Computer Associates, IBM,

Layer 7 Technologies, Microsoft, Netegrity,Oblix, OpenNetwork,

Ping Identity Corporation, Reactivity, RSA Security, VeriSign and Westbridge

Technology ·Public Draft

� WS-SecureConversation specifies how to manage andauthenticate message exchanges between parties includingsecurity context exchange and establishing and deriving session keys.

WS-PolicyAssertions1.1

BEA Systems, IBM, Microsoft, SAP

Public Draft

WS-Policy1.5

W3CWorking Draft

WS-PolicyAttachment1.2

W3CW3C Member Submission

WS-DiscoveryMicrosoft, BEA Systems, Canon,

Intel and webMethodsDraft

WS-MetadataExchange1.1

BEA Systems, Computer Associates, IBM, Microsoft, SAP, Sun Microsystems and

webMethodsPublic Draft

� WS-Policy describes the capabilities and constraints of the policies on intermediaries and endpoints (e.g. businessrules, required security tokens, supported encryptionalgorithms, privacy rules).

� WS-PolicyAssertions provides an initial set of assertionsto address some common needs of Web Servicesapplications.

� WS-PolicyAttachment defines two general-purposemechanisms for associating policies with the subjects towhich they apply; the policies may be defined as part of existing metadata about the subject or the policies may be defined independently and associated through an external binding to the subject.

� WS-Discovery defines a multicast discovery protocol fordynamic discovery of services on ad-hoc and managednetworks.

� WS-MetadataExchange enables a service to providemetadata to others through a Web services interface. Givenonly a reference to a Web service, a user can access a set of WSDL /SOAP operations to retrieve the metadata thatdescribes the service.

Universal Description,Discovery and Integration (UDDI)

3.0.2OASIS

OASIS-Standard

� Universal Description, Discovery and Integration (UDDI)defines a set of services supporting the description and discovery of businesses, organizations, and other Webservices providers, the Web services they make available,and the technical interfaces which may be used to accessthose services.

Management Of Web Services (WSDM-MOWS)

1.0OASIS

OASIS-Standard

WS-ManagementAMD, Dell, Intel, Microsoft and Sun

MicrosystemsPublished Specification

Management Using WebServices (WSDM-MUWS)

1.0OASIS

OASIS-StandardWeb Services for Remote

Portlets (WSRP)2.0

OASISCommittee Draft

� Web Service Distributed Management: Management OfWeb Services (WSDM-MOWS) addresses management ofthe components that form the network, the Web servicesendpoints, using Web services protocols.

� WS-Management describes a general SOAP-basedprotocol for managing systems such as PCs, servers,devices, Web services and other applications, and othermanageable entities.

Service Modeling LanguageIBM, BEA, BMC, Cisco, Dell, HP, Intel,

Microsoft, SunDraft Specification

� Servcie Modeling Language (SML) is used to modelcomplex IT services and systems, including their structure,constraints, policies, and best practices.

� Web Service Distributed Management: Management UsingWeb Services (WSDM-MUWS) defines how an IT resourceconnected to a network provides manageability interfacessuch that the IT resource can be managed locally and fromremote locations using Web services technologies.

� Web Services for Remote Portlets (WSRP) defines a set of interfaces and related semantics which standardizeinteractions with components providing user-facingmarkup, including the processing of user interactions withthat markup.

Web Service DescriptionLanguage 2.0 Core

2.0W3C

Candidate Recommendation

Web Service DescriptionLanguage 1.1

1.1W3CNote

Web Service DescriptionLanguage 2.0 SOAP Binding

2.0W3C · Working Draft

� WS-Business Activity provides the definition of the business activitycoordination type that is to be used with the extensible coordinationframework described in the WS-Coordination specification.

WS-Coordination1.1

OASISWorking Draft

� WS-Atomic Transaction defines protocols that enable existingtransaction processing systems to wrap their proprietary protocolsand interoperate across different hardware and software vendors.

� WS-Coordination describes an extensible framework for providingprotocols that coordinate the actions of distributed applications.

WS-Composite ApplicationFramework (WS-CAF)

1.0 · Arjuna Technologies, Fujitsu, IONA,Oracle and Sun Microsystems

Committee Specification� WS-Composite Application Framework (WS-CAF) is a

collection of three specifications aimed at solving problemsthat arise when multiple Web Services are used in combina-tion. It proposes standard, interoperable mechanisms formanaging shared context and ensuring business processesachieve predictable results and recovery from failure.

WS-Context (WS-CTX)1.0

Arjuna Technologies, Fujitsu, IONA, Oracleand Sun Microsystems

Committee Draft

� WS-Context (WS-CTX) is intended as a lightweight mechanismfor allowing multiple Web Services to share a common context.

WS-Coordination Framework (WS-CF)

1.0 · Arjuna Technologies, Fujitsu, IONA,Oracle and Sun Microsystems

Committee Draft� WS-Coordination Framework (WS-CF) allows the

management and coordination in a Web Services interactionof a number of activities related to an overall application.

WS-Transaction Management (WS-TXM)

1.0 · Arjuna Technologies, Fujitsu, IONA,Oracle and Sun Microsystems

Committee Draft� WS-Transaction Management (WS-TXM) defines a core infrastructure

service consisting of a Transaction Service for Web Services.

WS-Business Activity1.1

OASISWorking Draft

WS-Atomic Transaction1.1

OASISCommittee Draft

ResourceSpecifications

SOAP Message Transmission Optimization

Mechanism (MTOM)1.0 · W3C

Recommendation

SOAP1.2

W3CRecommendation

SOAP1.1

W3CNote

XML 1.11.1

W3CRecommendation

XML 1.01.0

W3CRecommendation

Namespaces in XML1.1

W3CRecommendation

XML Information Set1.0

W3CRecommendation

XML Schema1.1

W3CWorking Draft

XML binary OptimizedPackaging (XOP)

1.0W3C

Recommendation

� Describing Media Contentof Binary Data in XML(DMCBDX) specifies how toindicate the content-typeassociated with binaryelement content in an XMLdocument and to specify, inXML Schema, the expectedcontent-type(s) associatedwith binary elementcontent.

Describing Media Contentof Binary Data in XML

(DMCBDX)W3CNote

XML Specifications

� WS-Trust describes a framework for trust models that enablesWeb Services to securely interoperate. It uses WS-Security basemechanisms and defines additional primitives and extensionsfor security token exchange to enable the issuance anddissemination of credentials within different trust domains.

� WS-Security: Kerberos Binding defines how to encodeKerberos tickets and attach them to SOAP messages. Aswell, it specifies how to add signatures and encryption to theSOAP message, in accordance with WS-Security, which uses and references the Kerberos tokens.

WS-Addressing – Core1.0

W3CRecommendation

WS-EventingW3C

Public Draft

� WS-Addressing – Coreprovides transport-neutralmechanisms to addressWeb services and messages.This specification definesXML elements to identifyWeb service endpoints andto secure end-to-endendpoint identification inmessages.

WS-Addressing – WSDLBinding

1.0W3C

Candidate Recommendation

� WS-Addressing – WSDLBinding defines how theabstract properties definedin Web Services Addressing– Core are described usingWSDL.

WS-Addressing – SOAP Binding

1.0W3C

Recommendation

� WS-Addressing – SOAPBinding provides transport-neutral mechanisms toaddress Web services andmessages.

� WS-BaseNotificationstandardizes the terminology,concepts, operations, WSDLand XML needed to expressthe basic roles involved inWeb services publish andsubscribe for notificationmessage exchange.

WS-EnumerationSystinet, Microsoft, Sonic Software, BEA

Systems and Computer Associates

Public Draft

� WS-Enumeration describes a general SOAP-basedprotocol for enumerating a sequence of XMLelements that is suitablefor traversing logs, messagequeues, or other linearinformation models.

WS-Notification1.3

OASISOASIS-Standard

� WS-Notification is afamily of related whitepapers and specificationsthat define a standard Web services approach tonotification using a topic-based publish/subscribepattern.

WS-BaseNotification1.3

OASISOASIS-Standard

� WS-Eventing defines abaseline set of operationsthat allow Web services toprovide asynchronousnotifications to interestedparties.

WS-Topics1.3

OASISOASIS-Standard

� WS-Topics defines threetopic expression dialectsthat can be used as sub-scription expressions insubscribe request messagesand other parts of the WS-Notification system.

WS-BrokeredNotification1.3

OASISOASIS-Standard

� WS-BrokeredNotificationdefines the interface forthe NotificationBroker. A NotificationBroker is anintermediary, which, amongother things, allowspublication of messagesfrom entities that are notthemselves service providers.

� SOAP MessageTransmissionOptimizationMechanismdescribes anabstract feature foroptimizing thetransmission and/orwire format of aSOAP message.

� SOAP is a lightweight,XML-based protocol forexchange of informationin a decentralized,distributed environment.

WS-PolicyAssertions

Vers

ion

3.0

· Feb

ruar

y 20

07

Reliability SpecificationsWS-ReliableMessaging

WS-Reliability

WS-Reliable Messaging Policy Assertion

Tran

sact

ion

Resource SpecificationsWeb Service Resource Framework

WS-BaseFaults

WS-ResourceLifetime

WS-Transfer

Resource Representation SOAP Header Block (RRSHB)

WS-ServiceGroup

Mes

sagi

ng

Secu

rity

Tran

sact

ion

WS-ResourceProperties

Met

adat

a

Secu

rity

Basi

cPr

ofile

Presentation SpecificationsWeb Services for Remote Portlets

Mes

s.

Secu

r.

Relia

b.

Mes

sagi

ng

Secu

rity

Management Specifications

Reso

urce

Met

a

WS-Management

Management Of Web Services

Management Using Web Services

Service Modeling Language

Business Process Specifications

WS-Choreography Model Overview

Web Service Choreography Description Language

Web Service Choreography Interface

Business Process Management Language

Business Process Execution Language for Web Serv. 2.0

XML Process Definition Language

Business Process Execution Language for Web Services

Mes

sagi

ng

Tran

sact

ion

Secu

rity

Rel

iabi

lity

Transaction Specifications

Mes

sagi

ng

Secu

rity

Rel

iabi

lity

Met

adat

a

WS-Composite Application Framework

WS-Transaction Management

WS-Context

WS-Coordination Framework

WS-Business Activity

WS-Atomic Transaction

WS-Coordination

Standards BodiesThe Organization for the Advancement of Structured Information Standards (OASIS) is a not-for-profit, international consortium

that drives the development, convergence, and adoption of e-business standards. Theconsortium produces more Web services standards than any other organization along with stan-dards for security, e-business, and standardization efforts in the public sector and for applica-tion-specific markets. Founded in 1993, OASIS has more than 4,000 participants representingover 600 organizations and individual members in 100 countries.

The World Wide Web Consortium (W3C) was created in October 1994 to lead the World Wide Web to its full potential by developing common protocols that promoteits evolution and ensure its interoperability. W3C has over 350 Member organiza-

tions from all over the world and has earned international recognition for its contributions to thegrowth of the Web. W3C is designing the infrastructure, and defining the architecture and the coretechnologies for Web services. In September 2000, W3C started the XML Protocol Activity to addressthe need for an XML-based protocol for application-to-application messaging. In January 2002, theWeb Services Activity was launched, subsuming the XML Protocol Activity and extending its scope.

The Web Services Interoperability Organization (WS-I) is an open industry organization chartered to promote Web services interoperability across platforms,

operating systems and programming languages. The organization’s diverse community of Webservices leaders helps customers to develop interoperable Web services by providing guidance,recommended practices and supporting resources. Specifically, WS-I creates, promotes andsupports generic protocols for the interoperable exchange of messages between Web services.

The Internet Engineering Task Force (IETF) is a large open international community of network designers, operators, vendors, and researchers concerned with the evolution of the Internet architecture and the smooth operation of the Internet.

Attachments Profile1.0

WS-IFinal Specification

� Attachments Profile – The Attachment Profile 1.0complements the Basic Profile 1.1 to add support for interoperable SOAP Messages with attachments-basedWeb Services.

Simple SOAP Binding Profile

1.0WS-I

Final Specification

� Simple SOAP Binding Profile – The Simple SOAP BindingProfile consists of those Basic Profile 1.0 requirementsrelated to the serialization of the envelope and itsrepresentation in the message.

Business Process ExecutionLanguage for Web Services 1.1

(BPEL4WS) · 1.1 · BEA Systems, IBM,Microsoft, SAP,

Siebel Systems · OASIS-Standard

� WS-Choreography Model Overview defines the formatand structure of the (SOAP) messages that are exchanged,and the sequence and conditions in which the messagesare exchanged.

� Business Process Execution Language for Web Services1.1(BPEL4WS) provides a language for the formalspecification of business processes and business interactionprotocols using Web Services.

� Web Service Choreography Interface (WSCI) describeshow Web Service operations can be choreographed in thecontext of a message exchange in which the Web Serviceparticipates.

WS-Choreography ModelOverview

1.0 · W3CWorking Draft

Web Service ChoreographyInterface

(WSCI) · 1.0 · W3CSun Microsystems, SAP, BEA Systems

and Intalio · Note

Business Process Specifications

Business Process ExecutionLanguage for Web Services 2.0

(BPEL4WS) · 2.0OASIS, BEA Systems, IBM, Microsoft, SAP,

Siebel Systems · Committee Draft

� Business Process Execution Language for Web Services2.0 (BPEL4WS) provides a language for the formalspecification of business processes and business interactionprotocols using Web Services.

� Business Process Management Language (BPML)provides a meta-language for expressing businessprocesses and supporting entities.

Business Process ManagementLanguage (BPML)

1.1BPMI.org

Final Draft

� Web Service Choreography Description Language(CDL4WS) is to specify a declarative, XML based languagethat defines from a global viewpoint the common andcomplementary observable behaviour, where messageexchanges occur, and when the jointly agreed orderingrules are satisfied.

Web Service ChoreographyDescription Language

(CDL4WS) · 1.0 · W3CCandidate Recommendation

� XML Process Definition Language (XPDL) provides anXML file format that can be used to interchange processmodels between tools.

XML Process DefinitionLanguage (XPDL)

2.0Final

WS-ReliableMessaging1.1

OASISCommittee Draft

� WS-ReliableMessaging describes a protocol that allowsWeb services to communicate reliable in the presence ofsoftware component, system, or network failures. It definesa SOAP binding that is required for interoperability.

WS-Reliability1.1

OASISOASIS-Standard

� WS-Reliability is a SOAP-based protocol for exchangingSOAP messages with guaranteed delivery, no duplicates,and guaranteed message ordering. WS-Reliability isdefined as SOAP header extensions and is independent ofthe underlying protocol. This specification contains abinding to HTTP.

WS-Reliable Messaging Policy Assertion (WS-RM Policy)

1.1OASIS

Committee Draft

� Web Services ReliableMessaging Policy Assertion(WS-RM Policy) describes a domain-specific policy assertionfor WS-ReliableMessaging that that can be specified withina policy alternative as defined in WS-Policy Framework.

� Web Service Description Language 2.0 Core is an XML-based language for describing Web services and how toaccess them. It specifies the location of the service and theoperations (or methods) the service exposes.

� Web Service Description Language 1.1 is an XML-basedlanguage for describing Web services and how to accessthem. It specifies the location of the service and theoperations (or methods) the service exposes.

� Web Service Description Language SOAP Bindingdescribes the concrete details for using WSDL 2.0 inconjunction with SOAP 1.1 protocol.

WS-BaseFaults (WSRF)1.2

OASISWorking Draft

Web Services Resource Framework (WSRF)

1.2OASIS

OASIS-Standard

WS-ServiceGroup (WSRF)1.2

OASISWorking Draft

� WS-BaseFaults (WSRF) defines a base set of informationthat may appear in fault messages. WS-BaseFaults defines anXML schema type for base faults, along with rules for howthis base fault type is used and extended by Web Services.

� Web Services Resource Framework (WSRF) defines a family ofspecifications for accessing stateful resources using Web Services.

� WS-ServiceGroup (WSRF) defines a means by which WebServices and WS-Resources can be aggregated or groupedtogether for a domain specific purpose.

WS-ResourceProperties1.2

OASISWorking Draft

� WS-ResourceProperties specifies the means by which thedefinition of the properties of a WS-Resource may be declaredas part of the Web Service interface. The declaration of theWS-Resource properties represents a projection of or a viewon the WS-Resource state.

� WS-ResourceLifetime is to standardize the terminology,concepts, message exchanges, WSDL and XML needed tomonitor the lifetime of, and destroy WS-Resources.Additionally, it defines resource properties that may be usedto inspect and monitor the lifetime of a WS-Resource.

� WS-Transfer describes a general SOAP-based protocol foraccessing XML representations of Web service-based resources.

WS-ResourceLifetime1.2

OASISWorking Draft

WS-TransferW3C

W3C Member Submission

Resource RepresentationSOAP Header Block (RRSHB)

W3CRecommendation

� Resource Representation SOAP Header Block (RRSHB)complements MTOM by defining mechanisms fordescribing and conveying non-XML resource representationsin a SOAP 1.2 message.

http://www.innoq.com/resources/ws-standards-poster/Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 48 / 66

Page 49: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example of WSDL & SOAP

Definition of an operation: GetUserData

The operation has an input and an output

The input is defined via GetUserDataRequest

The output is defined via GetUserDataResponse

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 49 / 66

Page 50: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example of WSDL

<wsdl>

<wsdl:operation name="GetUserData">

<wsdl:input message="es:GetUserDataRequest"/>

<wsdl:output message="es:GetUserDataResponse"/>

</wsdl:operation >

<xsd:element name="GetUserDataRequest">

<xsd:complexType >

<xsd:sequence >

<xsd:element name="username" type="string"/>

<xsd:element name="role" type="string"/>

</xsd:sequence >

</xsd:complexType >

</xsd:element >

<xsd:element name="GetUserDataResponse">

<xsd:complexType >

<xsd:all >

<xsd:element name="email" type="string"/>

</xsd:all >

</xsd:complexType >

</xsd:element >

<wsdl>

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 50 / 66

Page 51: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example of SOAP

<soap:Envelope >

<soap:Body xmlns:m="http: //www.example.org/userdata">

<m:GetUserData >

<m:email >[email protected]</m:email >

</m:GetUserData >

</soap:Body >

</soap:Envelope >

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 51 / 66

Page 52: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Orchestration of Services

How are services interconnected with each other?

Applications are realized by a combination of services

Orchestration takes care which services interact and when

Control flow can be automated via workflow engines

Should help reuse by loose coupling and flexibility

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 52 / 66

Page 53: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Binding of Services

Development-time binding vs. runtime binding

Development-time binding is far simpler

The services, their API and address are fixed during development time

Runtime binding is more complex

The exact services and address are found during runtime

Lookup by service name often the best approach

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 53 / 66

Page 54: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Discovery of Services

How do I find the service for my needs?

UDDI aimed at a lookup service for businesses, organisation andservices

UDDI as yellow pages for web services

No widespread use

Should help addressability

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 54 / 66

Page 55: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Service Types

Typical service (component) types in SOA systems:

Application frontend - typically not a service, initiate operation andreceive results

Basic services - they build the foundation

Intermediary services - adapters and facades to add functionality,typically stateless

Process centric services - implement the business logic, typicallymanage the process state

Public services - for integration, higher level functionality

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 55 / 66

Page 56: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

SOA and Software Architecture

SOA aims to decouple the system from the software architecture

No alignment between the system layers and the service layers

system layers: browser, application server, web server, operation systemservice layers: application, process, intermediary, basic

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 56 / 66

Page 57: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example: Simple SOA Architecture

In the most simple case the SOA architecture consists of two layers

The application layer, which uses the basic services

The layer for the basic services

For example: A web site of an airline

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 57 / 66

Page 58: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example: Simple SOA Architecture

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 58 / 66

Page 59: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Facade Pattern

Intermediary services often serve as facade for basic services

They aggregate the functionality

Example for a n-tier architecture

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 59 / 66

Page 60: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example: Facade Pattern

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 60 / 66

Page 61: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Process-centric Services

Optional component in SOA systems

Process-centric services encapsulate process logic and applicationstate

An application frontend may delegate the process control to such acomponent

Advantage: reuse when the process-centric services is shared bymultiple clients

Disadvantage: more complex system, process control might be splitinto multiple components

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 61 / 66

Page 62: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example: Process-centric Services

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 62 / 66

Page 63: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Best practices

Limit access to data

Have a single service to manage the data

For example, instead of two services with two interfaces provide asingle service with two interfaces

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 63 / 66

Page 64: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Example of Cross-Cutting Concerns

Example of how to tackle cross-cutting concerns with SOA:

Logging of information, warning, failures, etc.

⇒ Log locally, but view globally

Each service uses a local logging functionality, logs are thenaggregated

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 64 / 66

Page 65: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Security in SOA

Additional security considerations for services

How to protected against attacks?

Trusted domain vs. securing every service

Trust domains usually in use for base services

Use unified security framework

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 65 / 66

Page 66: WWW Architecture II - KTIkti.tugraz.at/staff/denis/courses/sa/slides_ · WWW Architecture II Software Architecture VO/KU (707.023/707.024) Denis Helic, Roman Kern KMI, TU Graz Dec

Service Oriented Architectures

Section

Questions?

Denis Helic, Roman Kern (KMI, TU Graz) WWW Architecture II Dec 5, 2012 66 / 66