integration of web service stacks in an esb
DESCRIPTION
JavaOne 2009TRANSCRIPT
Integration of Web Service Stack in an Enterprise Service Bus
Wen ZhuModel Driven Solutionswww.modeldriven.com
2
Questions
What is the relationship between Web Services and ESB?
And how they can work together in your composite application?
3
Agenda
> Background
> ESB-Web Service Integration Approaches
> Demo
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.
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
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
7
Java Business Integration
Source: Apache ServiceMix
NMR modeled after MEP in WSDL 2.0
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
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
FTP
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
11
Web Services Stacks> Examples:
� Metro� Apache CXF� JBossWS
� Native� Metro� CXF
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
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“>
……
14
OpenESB-Metro Integration> Web Service Stack In the Binding Component> Service Hosted in the Application Server
HTTP Endpoint
Service Implementation
QoS?
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
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
17
ServiceMix-CXF Integration> Separate Components for Hosting Service Implementations and
Exposing Web Service Endpoints
HTTP Endpoint
Service Implementation
QoS?
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
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
20
JBossESB-JBossWS Integration
> SOAP Processing Outside ESB
21
JBossESB-JBossWS Integration Approach> Alternative Approach
Can change to support other protocols
SOAP Messages being passed
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
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
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!
25
Question
How do I Preserve IT Investments in the Face of Technology Changes?
26
No matter which technology wins, the business requirement remains.
Which technology platform should we choose?
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
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”
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
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.
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.
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
33
Demo
34
> Current Projects� The ModelPro™ Project� ModelPro™ Cartridge Projects� Foundational UML Reference
Implementation> Get Involved!
ModelDriven.orgThe Open Source Model Driven Community
35