Web Service Orchestration with BPEL - sbu.ac.ir

54
SOA Service Oriented Architecture Dr. F. Shams A. Mahjoorian CSICC2007 Workshop

Transcript of Web Service Orchestration with BPEL - sbu.ac.ir

Page 1: Web Service Orchestration with BPEL - sbu.ac.ir

SOAService Oriented Architecture

Dr. F. ShamsA. Mahjoorian

CSICC2007 Workshop

Page 2: Web Service Orchestration with BPEL - sbu.ac.ir

2SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Table of Content

What is SOA?

SOA Items

SOA Implementation

Conclusion

Page 3: Web Service Orchestration with BPEL - sbu.ac.ir

3SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is SOA?

Overview

SOA Definition

SOA Benefits

EA Future

What is Service ?

What is Web Service ?

Effect of SOA on current systems

Page 4: Web Service Orchestration with BPEL - sbu.ac.ir

4SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is Service?

A unit of work done by a service provider to achieve desired end

results for a service consumer. Both provider and consumer are

roles played by software components

A service in SOA is an exposed piece of functionality with three

major properties:

• The interface contract to the service is platform-independent.

• The service can be dynamically located and invoked.

• The service is self-contained. That is, the service maintains its

own state.

Page 5: Web Service Orchestration with BPEL - sbu.ac.ir

5SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is a Web service?

any Service that is callable by another program

across the Web in a way that is:

• platform-independent,

• language-independent &

• object model-independent

So Web Service= web-base Service

Uses “next generation” infrastructure

standards:

• XML, SOAP, WSDL, UDDI

Page 6: Web Service Orchestration with BPEL - sbu.ac.ir

6SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Next-generation architecture strategies — the road to SOA

Batch

On-line

midrange

Client/

server

Web

client

Service

Oriented

Architectures

1970s 1980s 1990s 2000s 2010s

Page 7: Web Service Orchestration with BPEL - sbu.ac.ir

7SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA is …

Service-oriented architecture (SOA) is an approach to loosely coupled, protocol independent, standards-based distributed computing where software resources available on the network are considered as Services.

SOA is believed to become the future enterprise technology solution that promises the agility and flexibility the business users have been looking for by leveraging the integration process through composition of the services spanning multiple enterprises.

Communication infrastructure used within an SOA should be designed to be independent of the underlying protocol layer.

Page 8: Web Service Orchestration with BPEL - sbu.ac.ir

8SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Layers

Page 9: Web Service Orchestration with BPEL - sbu.ac.ir

9SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is SOA ?

SOA should be business oriented

SOA is a way of thinking

SOA is not Web Services

Loosely coupled architecture that uses messaging

Enriched by creating composite Apps

Move from batch to real-time

Build reusable business components (Services)

Provide agility and flexibility

Page 10: Web Service Orchestration with BPEL - sbu.ac.ir

10SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Difference between “Service” , “Web Service” and

“Web Application”

Component= Reusable, Portable, Well-Defined, reliable,

extendable Modules

Service= Business-Driven Platform-Independent Component

Web Service= Web-Base Service

Web Application = application used by a user

Web Service = application used by another application

Page 11: Web Service Orchestration with BPEL - sbu.ac.ir

11SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

As-Is Application : Integration Problem !

Page 12: Web Service Orchestration with BPEL - sbu.ac.ir

12SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

IT Strategy in 2004

Page 13: Web Service Orchestration with BPEL - sbu.ac.ir

13SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Companies Are Moving Forward Now With SOA

Enterprise-wide

SOA up 200%

Department-wide

SOA up 300%,

Q: What Stage Is Your Company Currently In With Respect to SOA?

Don't Know

Not Planning to Deploy

Evaluation

Pilot Projects

Department-wide SOA

Enterprise-wide SOA

2005

2006

32%

21%

20%

13%

4%

8%

12%

7%

25%

28%

12%

16%

Page 14: Web Service Orchestration with BPEL - sbu.ac.ir

14SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Benefit (IBM)

Business Benefits

Business flexibility provided by increased granularity of processes

Ability to quickly create business processes and composite applications to respond to changes in the marketplace

Improved customer service, without having to worry about the underlying IT infrastructure

IT Benefits

Becoming a more responsive IT organization

Decreasing development and deployment cycle times through the use of pre built, reusable services building blocks

Reducing complexity and maintenance costs with common services

Enhancing existing IT systems rather than replacing them

Page 15: Web Service Orchestration with BPEL - sbu.ac.ir

15SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA is well-suited to reuse current applications

Application -> Service

Service

Application Landscape

Service

Service

Service

ServiceServic

e

Service

Service Servic

e

Service

Service

Service

Service

Service

SOA Organization

Page 16: Web Service Orchestration with BPEL - sbu.ac.ir

16SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA is well-suited to built new applications

Service -> Application

Create new applications

ServiceService

ServiceService

ServiceService

ServiceService

Service

Service

Service

Service

Service

Use / reuse

Page 17: Web Service Orchestration with BPEL - sbu.ac.ir

17SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Change work …

Application ApplicationApplication Application

Application Application Application Application

App App App App

App App App App

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Turn this… …into this

Page 18: Web Service Orchestration with BPEL - sbu.ac.ir

18SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA + Enterprise Service Bus (ESB)

App App App App

App App App App

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

Service

Interface

…into this Turn this…

ESB

Page 19: Web Service Orchestration with BPEL - sbu.ac.ir

19SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA, Legacy, and the ESB

New Flight

Availability

Service

Old Flight

Availability

Service

Hotel

Availability

Service

Book

Hotel

Service

Book

Car

Service

Travel

Reservation

Process

New Check

Traveler

Service

Check Credit

Service

Book Flight

Service

Add new

services

faster

Change services

with minimal

impact to Existing

services

Flight

Availability

Service

Enterprise Service Bus

Page 20: Web Service Orchestration with BPEL - sbu.ac.ir

20SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Why shift to Service Orientation

Connections = cost

Function oriented

Build to last

Prolonged development

From To Connections = value

Process oriented

Build for change

Incrementally

deployed

Application silos

Vendor silos

Tightly coupled

Object oriented

Orchestrated

solutions

Multi-vendor

Loosely coupled

Message oriented

Page 21: Web Service Orchestration with BPEL - sbu.ac.ir

21SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Items

XML

WSDL

BPEL

SOAP

UDDI

Page 22: Web Service Orchestration with BPEL - sbu.ac.ir

22SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Server, Users and UDDI

Page 23: Web Service Orchestration with BPEL - sbu.ac.ir

23SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is XML?

Standard data types and structures, independent of any

programming language, development environment, or software

system.

<book>

<authors>

<author>

<title>Joliet</title>

<first>Jake</first>

<last>Blues</last>

</author>

</authors>

<title>Shades of Blue</title>

<publisher>Free Forest

Publishing</publisher>

</book>

Page 24: Web Service Orchestration with BPEL - sbu.ac.ir

24SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is WSDL?

A WSDL file, in XML structure, contains details about provider (server) services

For each service the provider supports, WSDL describes the set of operations

For each operation, WSDL describes formats of messages exchanged between the requesting consumer (client) and the provider (server)

Page 25: Web Service Orchestration with BPEL - sbu.ac.ir

25SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What Is BPEL?

Business Process Execution Language, platform independent, XML-based

A language to specify the behavior of business processes between Web services and as Web services

Contains process flow constructs for conditional branching, parallel processes, nested sub-processes, process joins, etc.

Uses WSDL to describe process interfaces so that they can be more easily integrated into other processes or applications.

Provided as an open standard under royalty free terms.

Platform independence – XML based language (Java, .Net implementations available)

Page 26: Web Service Orchestration with BPEL - sbu.ac.ir

26SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Page 27: Web Service Orchestration with BPEL - sbu.ac.ir

27SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

BPEL Structure Overview

<process>

<partners> … </partners>

<variables> … </variables>

<correlationSets> … </correlationSets>

<faultHandler> … <faultHandler>

<compensationHandler> … </compensationHandler>

<eventHandler> … </eventHandler>

(activities)*

</process>

activities = <receive>, <reply>, <invoke>, <assign>, <throw>,<terminate>, <wait>, <empty>, <sequence>, <switch>,<while>, <pick>, <flow>, <scope>, <compensation>

Page 28: Web Service Orchestration with BPEL - sbu.ac.ir

28SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is SOAP?

Shortcut for Simple Object Access Protocol

(SOAP)

SOAP is an XML notation for describing how

messages are assembled and transmitted

over HTTP between service consumers

(clients) and service providers (servers)

SOAP = XML + HTTP

Page 29: Web Service Orchestration with BPEL - sbu.ac.ir

29SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

What is UDDI ?

UDDI is a platform-independent framework for describing services, discovering businesses, and integrating business services by using the Internet.

• 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

Page 30: Web Service Orchestration with BPEL - sbu.ac.ir

30SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

UDDI specification help to :

Making it possible to discover the right business from the millions currently online

Defining how to enable commerce once the preferred business is discovered

Reaching new customers and increasing access to current customers

Expanding offerings and extending market reach

Solving customer-driven need to remove barriers to allow for rapid participation in the global Internet economy

Describing services and business processes programmatically in a single, open, and secure environment

Page 31: Web Service Orchestration with BPEL - sbu.ac.ir

31SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Flexibility vs. Interoperability

Interoperability

Fle

xib

ility

Flat file + FTP

Web services

CORBA

Page 32: Web Service Orchestration with BPEL - sbu.ac.ir

32SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Implementation

Sample of Web Service

BPEL Implementation

SOAP

Page 33: Web Service Orchestration with BPEL - sbu.ac.ir

33SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Example: Using UDDI with SOAP and WSDL

SAP

User UDDI Directory

WSDLSOAP

Request

SOAP

Response

UDDI

Request

Page 34: Web Service Orchestration with BPEL - sbu.ac.ir

34SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

ASP.NET Web Service example

<%@ WebService Language="VB" Class="TempConvert" %>

Imports System

Imports System.Web.Services

Public Class TempConvert :Inherits WebService

<WebMethod()> Public Function FahrenheitToCelsius (ByVal Fahrenheit As Int16) As Int16

Dim celsius As Int16

celsius = ((((Fahrenheit) - 32) / 9) * 5)

Return celsius

End Function

<WebMethod()> Public Function CelsiusToFahrenheit

(ByVal Celsius As Int16) As Int16

Dim fahrenheit As Int16

fahrenheit = ((((Celsius) * 9) / 5) + 32)

Return fahrenheit

End Function

End Class

Page 35: Web Service Orchestration with BPEL - sbu.ac.ir

35SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

ASP.NET Web Service example

This Code is a .asmx file. This is the ASP.NET file

extension for XML Web Services.

The only difference from a normal application is that

this function is defined as a "WebMethod".

Use "WebMethod" to mark the functions in your

application that you would like to make into web

services.

The ASP.NET has automatically created a WSDL and

SOAP request.

Page 36: Web Service Orchestration with BPEL - sbu.ac.ir

36SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Web Browser vs. Web Service

Mainframe

.asmx file type

(ASP.NET Service)

ASP.NET Webpage

SOAP

Internal Service Call

HTTP

WEB

Web

Browser

We

b S

erv

er

Service Provider

Service Requester

Page 37: Web Service Orchestration with BPEL - sbu.ac.ir

37SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Find a Web Service example

Page 38: Web Service Orchestration with BPEL - sbu.ac.ir

38SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Page 39: Web Service Orchestration with BPEL - sbu.ac.ir

39SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

HT

TP

XM

L

SOAP Request Format

Page 40: Web Service Orchestration with BPEL - sbu.ac.ir

40SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA Response Format

Page 41: Web Service Orchestration with BPEL - sbu.ac.ir

41SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Elements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksplaceholders for process callers

and service providers

Variableshold data used in

the business process

FaultHandlersenclose activities

that are performed in cases of error

CorrelationSets

support process instance identification

Activitiessubtasks of the process

Control Linksdefine the process'

control flow

Page 42: Web Service Orchestration with BPEL - sbu.ac.ir

42SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

BPEL Models

<sequence>

<flow>

<pick>

Serialized <send>,

<receive>,

<invoke>, <…>

parallel <send>,

<receive>, <invoke>,

<…>

Wait for one or more

<receive> or an

alarm condition

Page 43: Web Service Orchestration with BPEL - sbu.ac.ir

43SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

BPEL Models

<switch>

<case />

</switch>

While

Page 44: Web Service Orchestration with BPEL - sbu.ac.ir

44SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Executing BPEL

<process>

<sequence>

<receive

… />

<invoke

… />

</sequence>

</process>

Loan Service

(Orchestration)

Credit

Validation

Service

Loan

Service 1

Loan

Service 2

You’re

approved!

Page 45: Web Service Orchestration with BPEL - sbu.ac.ir

45SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

BPEL for Loan Service

<process>

<sequence>

<invoke>

<receive>

….

<while><invoke>

<receive>

</While>

….

</sequence>

</process>

Page 46: Web Service Orchestration with BPEL - sbu.ac.ir

46SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

WSDL Sample

<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>

Page 47: Web Service Orchestration with BPEL - sbu.ac.ir

47SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Web services and SOAP messaging

1. The Web service client creates and sends a SOAP message

2. The SOAP server listens for SOAP messages. SOAP server is an application running in an Application Server

3. The SOAP server processes the SOAP messages and passes the request to a Web service

4. The Web service runs the specified method and returns the result to the SOAP server

5. The SOAP server forwards the result back to the Web service client

6. The Web service client parses SOAP response.

Page 48: Web Service Orchestration with BPEL - sbu.ac.ir

48SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Conclusion

SOA Concept …

SOA Benefits

SOA vs. others Issues

Page 49: Web Service Orchestration with BPEL - sbu.ac.ir

49SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

So SOA is …

SOA and Web services are the tools that enable IT to

accommodate business requests for flexibility while optimizing

enterprise application investments.

An Application Architecture that is designed to achieve loose

coupling among interacting software applications. SOA provides

greater flexibility in developing, integrating, and managing

Enterprise Applications

A set of components which can be invoked, and whose interface

descriptions can be published and discovered (W3C)

A methodology for achieving application interoperability and reuse

of IT assets that features:

The concept of SOA isn’t new—what is new is the ability to mix

and match execution environments, clearly separating the service

interface from the execution technology

Page 50: Web Service Orchestration with BPEL - sbu.ac.ir

50SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA is all that we need

Workflow

EDI

Mainframe

1980 1990 2000 2010

XMLWS

WebLANInternet

?Business

Integration

J2EE

.NET

Client / Server

Web/Portal

EAI

B2B

BPM

WS

Office

SOA

SOA

Page 51: Web Service Orchestration with BPEL - sbu.ac.ir

51SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

SOA benefits

Reuse—The ability to create services that are reusable in multiple applications.

Efficiency—The ability to quickly and easily create new services and new applications using a combination of new and old services, along with the ability to focus on the data to be shared rather than the implementation underneath.

Loose technology coupling—The ability to model services independently of their execution environment and create messages that can be sent to any service.

Division of responsibility—The ability to more easily allow business people to concentrate on business issues, technical people to concentrate on technology issues, and for both groups to collaborate using the service contract.

Page 52: Web Service Orchestration with BPEL - sbu.ac.ir

52SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

Enterprise without SOA:Not Integrated (Spaghetti-Like) Architecture

Page 53: Web Service Orchestration with BPEL - sbu.ac.ir

53SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

CORBA vs. SOA

The original goals of CORBA are very similar to the

goals of Web services. CORBA didn’t succeed widely

because of vendor politics, and there’s some truth to

that. However, CORBA also hurt itself in its early days

by not defining a standard for interoperability.

SOA isn’t new

What is new is the ability to mix and match

execution environments, clearly separating the

service interface from the execution technology

Page 54: Web Service Orchestration with BPEL - sbu.ac.ir

54SOA Workshop: Dr. F. Shams, A. Mahjoorian © 2007www.ieaf.ir

En

terp

ris

e S

OA

[email protected]

[email protected]