integration of web service stacks in an esb

35
Integration of Web Service Stack in an Enterprise Service Bus Wen Zhu Model Driven Solutions www.modeldriven.com

Upload: wen-zhu

Post on 07-Jul-2015

522 views

Category:

Education


2 download

DESCRIPTION

JavaOne 2009

TRANSCRIPT

Page 1: Integration of Web Service Stacks in an Esb

Integration of Web Service Stack in an Enterprise Service Bus

Wen ZhuModel Driven Solutionswww.modeldriven.com

Page 2: Integration of Web Service Stacks in an Esb

2

Questions

What is the relationship between Web Services and ESB?

And how they can work together in your composite application?

Page 3: Integration of Web Service Stacks in an Esb

3

Agenda

> Background

> ESB-Web Service Integration Approaches

> Demo

Page 4: Integration of Web Service Stacks in an Esb

4

Background

> Based on our work on Service Oriented Infrastructure (SOI) at a US large federal agency

> Model Driven Solutions is a leading provider of professional services and products that leverage Services Oriented Architecture (SOA), Model Driven Architecture (MDA) and the Semantic Webtechniques and standards.

Page 5: Integration of Web Service Stacks in an Esb

5

Context> Objectives

� Establish principles and patterns for reuse, interoperability, and agility

� Elaborate the relationship of ESB and BPMS� Focus on Open source, open standard based ESB

� More specially, Java EE5/JBI

> ESB Products� Apache ServiceMix v3.3 (IONA Fuse ESB 3.3.1.1)� OpenESB v2 (Sun Java Application Server 9.1 Update 2)� JBossESB 4.4 Plus

� JBoss Application Server 4.2.3� JBossWS Metro Implementation 3.0.3

Page 6: Integration of Web Service Stacks in an Esb

6

Java Business Integration

> JBI� Defined with in Java Community Process

(JCP) as JSR 208� JBI Specification 1.0 published in 2005� Standard basis for a Java EE based ESB

> ESB� A pattern of middleware that unifies and

connects services, applications and resources

> SOA� An architectural style for a community of

providers and consumers of services to achieve mutual value

SOA

ESB

JBI

Is a Standard for

Is an Architectural Pattern for

Page 7: Integration of Web Service Stacks in an Esb

7

Java Business Integration

Source: Apache ServiceMix

NMR modeled after MEP in WSDL 2.0

Page 8: Integration of Web Service Stacks in an Esb

8

Approach> Refactoring a J2EE Web Service Application for ESB

� Reuse existing J2EE code� Leverage ESB services� Better Maintainability through policy management

> As-Is Application� J2EE Web Service Deployed as a WAR file

> To-Be Application: (JBI) Composite Application� Expose the same functional Web Service interface� Separate infrastructure concerns from business logic� Leverage components from Open Source communities

Page 9: Integration of Web Service Stacks in an Esb

9

To-be Application Architecture

> Mapping to ESB-specific components

> Issue: � ESB Implementations rely

on Web Service Stacks� A Web Service Stack

provides both the web service endpoint and the service container contract

JBI Composite Application

ESB

Service Engine

Transactional

Service

SOAP/HTTP

Binding Component

Security

Reliable Messaging

WS Transaction

Service Engine

Transactional

Process Flow

Service Engine

Validation

Logic

Other

Binding Components

File

Email

FTP

Page 10: Integration of Web Service Stacks in an Esb

10

Java API for XML-based Web Services (JAX-WS)> Standard for developing SOAP based and RESTful Java

Web services. � Designed to replace JAX-RPC� Release in 2006, currently version 2.1

> Specification Contents� WSDL Mapping� API

� Client API� Service API� Core API

� Annotations � Customization

> Our focus: Web Service Implementation at Runtime

Page 11: Integration of Web Service Stacks in an Esb

11

Web Services Stacks> Examples:

� Metro� Apache CXF� JBossWS

� Native� Metro� CXF

Page 12: Integration of Web Service Stacks in an Esb

12

Aspects of Web Service> A Service Container

> A SOAP/REST Endpoint Provider

import javax.jws.WebService;@WebServicepublic class EchoService {

public String echo(String input){return input;

}}

POST /EchoService HTTP/1.1 Host: www.example.comContent-Type: text/xml; charset="utf-8" Content-Length: nnnnSOAPAction: "Some-URI" <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soapenv:Body> ……

WSDL JavaWSDL Java Mapping

Service API and Annotations

Page 13: Integration of Web Service Stacks in an Esb

13

Aspects of Web Service> Quality of Service Considerations

<wsd:binding …… ><wsp:PolicyReference URI="PasswordAuthenticationOver SSL"/><wsp:PolicyReference URI="ReliableMessaging"/>

</wsdl:binding …..>

<wsp:Policy wsu:Id="ReliableMessaging"><wsp:ExactlyOne>

<wsp:All><wsaws:UsingAddressing

xmlns:wsaws="http://www.w3.org/2006/05/addressing/w sdl"/><wsrm:RMAssertion

xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/r m/policy"/></wsp:All>

</wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id="PasswordAuthenticationOverSSL“>

……

Page 14: Integration of Web Service Stacks in an Esb

14

OpenESB-Metro Integration> Web Service Stack In the Binding Component> Service Hosted in the Application Server

HTTP Endpoint

Service Implementation

QoS?

Page 15: Integration of Web Service Stacks in an Esb

15

OpenESB Composite Application

Glassfish

OpenESB Composite Application

Oracle

Database

SOAP BC BPEL SE

(Business

Rule Validation)

Java EE SE EJB

Web ServiceJAXWSSOAP

JDBC

Service

Client

Page 16: Integration of Web Service Stacks in an Esb

16

OpenESB-Metro Integration: Observations> Web Service Stack In the Binding Component

� Avoid Integration Issues� Excellent QoS and Policy Support

> Service Hosted in the Application Server� Extra Component Required

Page 17: Integration of Web Service Stacks in an Esb

17

ServiceMix-CXF Integration> Separate Components for Hosting Service Implementations and

Exposing Web Service Endpoints

HTTP Endpoint

Service Implementation

QoS?

Page 18: Integration of Web Service Stacks in an Esb

18

ServiceMix Composite Application

ServiceMix

Oracle

Database

CXF BC JMS BC JMS BC

(Start XA

Transaction)

Service

Client

Web Service

JAXWS

SOAP

JDBC

JMS Queue

JMS/JCA JMS/JCA

POJO

(Business Rule

Validation)

CXF SE

Page 19: Integration of Web Service Stacks in an Esb

19

ServiceMix-CXF Integration: Observations> Separate Components for Hosting Service Implementations and

Exposing Web Service Endpoints� Clean Separation of Concerns

> Introduced Additional Integration Issues> Transaction Management without an Application Server can

be challenging

Page 20: Integration of Web Service Stacks in an Esb

20

JBossESB-JBossWS Integration

> SOAP Processing Outside ESB

Page 21: Integration of Web Service Stacks in an Esb

21

JBossESB-JBossWS Integration Approach> Alternative Approach

Can change to support other protocols

SOAP Messages being passed

Page 22: Integration of Web Service Stacks in an Esb

22

Document Centric Architecture with ESB and JAX-WS

> Data mappings increase complexity and limit flexibility� JAXB� O/R

Web

Service

Stack

Service

Implementation

Persistence

Tier RDBMS

JAXBJAXB

SEISEI

O/R

Mapping

O/R

Mapping

Relational

Data

Relational

Data

JavaJava

XML/SOAPXML/SOAP

Page 23: Integration of Web Service Stacks in an Esb

23

Document Centric Architecture with ESB and JAX-WS

Web

Service

Stack

Service

ImplementationXML

Database

JAX-WS Provider

API

JAX-WS Provider

APIXML/ XPathXML/ XPath

Java/ XSLTJava/ XSLT

XML/SOAPXML/SOAP

Binding Component

Service

Implementation

XSLTXSLT

Service Engine

Page 24: Integration of Web Service Stacks in an Esb

24

Document Centric Architecture with ESB and JAX-WS: Challenges> Technology Limitations

� Support for Provider-based API in the ESB� Storing XML data in relational database

> Readability/Maintainability

Element person = ….

String name = person.getAttribute("name");

Person person = ….

String name = person.getName();

Model Driven Architecture Helps!

Page 25: Integration of Web Service Stacks in an Esb

25

Question

How do I Preserve IT Investments in the Face of Technology Changes?

Page 26: Integration of Web Service Stacks in an Esb

26

No matter which technology wins, the business requirement remains.

Which technology platform should we choose?

Page 27: Integration of Web Service Stacks in an Esb

27

OpenESB

ServiceMixBusiness Concerns

Business Concerns

Business

Services

Quality of Service

Business Rule

JBossESB

DROOLS?

Schema?

XSLT?

JAX-WS

Business Process

BPEL

Platform

Specific API

Models

TechnicalArchitecture

Platform

Executable

Artifact

Generates

Specifies

ProvisioningTool

Enterprise Challenges In The Face Of Technology Change:

-Reusability

-Maintainability

-Interoperability

Model Driven Architecture for “Technology Independent Service”

“Architecture Choice for a Changing World”- Object Management Group

Captures business concerns using standard tools and notations

Addresses technology concerns such as interoperability, scalability, maintainability and reusability

Generates executable artifacts for a particular technical architecture

Page 28: Integration of Web Service Stacks in an Esb

28

What MDA is not…..

> Model is not just pretty pictures� Execution Semantic

> MDA is not just about code generation� Especially not just about boiler plate code!

Can run on a model “VM”

Can run on a model “VM”

Page 29: Integration of Web Service Stacks in an Esb

29

SoaML and Model Driven Architecture (MDA)

Computation Independent ModelComputation Independent Model

Platform Independent ModelPlatform Independent Model

Platform Specific Model/ImplementationPlatform Specific Model/Implementation

Open Source eGov Reference

Architecture

Open Source eGov Reference

Architecture

As-Is SystemsAs-Is Systems

Stakeholders

Business Drivers

As-Is Business Processes

Stakeholders

Business Drivers

As-Is Business Processes

Plan and Design Develop and Deliver

ProvideAfter Care

Mission-Critical Value Chain

Plan and Design Develop and Deliver

ProvideAfter Care

Mission-Critical Value Chain

Value ChainsSOA Contracts Information Model

Business Context

Service-Oriented Architecture

Data Model

<wsdl:porttype>

…</wsdl:portype>Web Services Components

Service Architecture

Service Provisioning

Service Interface

Page 30: Integration of Web Service Stacks in an Esb

30

SoaML: Modeling Business Services

<<ServiceContract>> : Solicitation Management Service

<<ServiceContract>> : Vendor Solicitation Service

<<Participant>> : Solicitation Owner Agency

<<Participant>> : Solicitation Manager

<<Participant>> : Vendor

<<ServicesArchitecture>>Solicitation Management Service Architecture

<<component>>Solicitation Management

Service

<<Participant>>Solicitation Owner Agency

<<ServicePoint>>notification

<<Participant>>Solicitation Manager<<ServicePoint>>

<<ServicePoint Provisioning>>response

<<ServicePoint>> solicitation

type

type

solicitation manager

solicitation manager

vendor

solicitation owner

A services architecture describes how participantswork together for a purpose by providing and using

services expressed as service contracts. It is modeled as a UML collaboration.

A services architecture describes how participantswork together for a purpose by providing and using

services expressed as service contracts. It is modeled as a UML collaboration. A participant represents some party

that provides and/or consumes services. Participants may represent

people, organizations or systems.

A participant represents some party that provides and/or consumes

services. Participants may represent people, organizations or systems.

A service contract is the specification of the agreement between providers and consumers of

a service as to what information, products, assets, value and obligations will flow between them. It specifies the service without regard for

realization, capabilities or implementation.

A service contract is the specification of the agreement between providers and consumers of

a service as to what information, products, assets, value and obligations will flow between them. It specifies the service without regard for

realization, capabilities or implementation.

Page 31: Integration of Web Service Stacks in an Esb

31

Provisioning for Technology Platforms

<<JEE Web Service>> : Solicitation Management Service

<<ServicePoint>><<ServicePoint Provisioning>>

{usedInterfaceAddress = "http://solicitationowner.gov/notify" }

response

<<ServicePoint>>

solicitation

<<Entity Override>> : Response

<<Entity Override>> : Solicitation

<<JEE Provisioning>><<Provision>>

Java EE Server 1{runtime = "GlassFish v2.1 Java EE 5"}

<<JEE Web Service>> : Solicitation Owner Agency

<<JEE Provisioning>>

Java EE Server 2{runtime = "JBoss v5.0"}

A components can be deployed on a specific physical tier. A tier is

modeled as a UML node.

A components can be deployed on a specific physical tier. A tier is

modeled as a UML node.

Service connections across tiers are modeled

as UML assembly dependencies.

Service connections across tiers are modeled

as UML assembly dependencies.

Page 32: Integration of Web Service Stacks in an Esb

32

Application Deploy

Platform & Tools (E.G. Eclipse/Netbeans/.NET)

ManualPlatform

ApplicationArtifacts

ModelPro (ModelDriven.org)Open Source MDA Tools

ModelPro™ Project: The Open Source Provisioning Engine

ModelProProvisioning

Engine

Implements

Use

s

SoaML Cartridge for

JEE

Provisioning Profile

Automates

AutomatedPlatform

Application & IDEArtifacts

UsesUML Tool

Provisioning Model

Users SOAModel

Uses

OMG SoaMLUML Profile

Page 33: Integration of Web Service Stacks in an Esb

33

Demo

Page 34: Integration of Web Service Stacks in an Esb

34

> Current Projects� The ModelPro™ Project� ModelPro™ Cartridge Projects� Foundational UML Reference

Implementation> Get Involved!

ModelDriven.orgThe Open Source Model Driven Community

Page 35: Integration of Web Service Stacks in an Esb

35

Wen [email protected]