4. What is “Service Oriented
Architecture”?
"Things should be made as simple as possible, but no simpler." -- Albert
Einstein
Applications build on Loosely Coupled Services
◦ Distributed resources
◦ Made available as independent services
◦ Services that are interoperable
◦ Interoperability based on contracts
Separation of Concerns
7. Fundamental SOA
Only basic services
◦ Data-centric: exposes resources
◦ Logic-centric: encapsulate business rules
Resources are never shared between services
Better Maintainability
8. Networked SOA
Introduce intermediate services
◦ Techonology Gateways
◦ Adapters
◦ Façades (?)
◦ Decorating services
Easier integration into Application frontends
More Flexibility
9. Process-Enabled SOA
Introduce process-centric service(s)
◦ Statefull intermediate service
◦ Hides process state from application frontend
◦ Process state can be shared for multiple users
◦ Can be event driven
Application frontend concentrates on User Interface (GUI or B2B)
Full Separation of Concerns
11. Implementing Services
Traditional Web Services: RPC
◦ Remote Procedure Call
SOA Web Services: contract first
◦ First define the messages, then implement the code
◦ Maximum interoperability
12. JAXB 2: Java Architecture for XML Binding
Java 6 standard extension for Java/XML Binding
SchemaGen: generate xsd/wsdl from java pojo’s
◦ Customisable with javax.xml.bind annotations
◦ javax.jws @WebService/ @WebMethod annotations
XJC: generate java from xsd/wsdl
◦ Generate pojo’s with javax.xml.bind/javax.jws annotations
◦ Customisable with xsd annotations or binding files
◦ Plugin API for e.g. naming conventions or generating EJB3
annotations
◦ Ant task, maven plugin, eclipse plugin
Code example
13. Implementing services with XFire and Spring
Codehaus XFire: next generation java SOAP
◦ Support for newest standards:
◦ JAXB 2.0: annotation based XML binding
◦ JSR-181/JAX-WS 2.0: annotations for WSDL generation
◦ POJO based
◦ Integration with Spring-core and Spring-MVC
Code example
14. Implementing services with
Spring-WS
Document-driven web services
◦ Can use XML directly as SAX, DOM, StAX…
◦ For efficiency, flexibility
◦ Can plugin Castor/JAXB/JiBX Marshallers
Similar architecture as Spring-MVC
◦ Configurable Dispatcher
◦ Endpoints as Controllers
◦ Mappings/Filters/Interceptors…
Code example
16. About JBI
Standards based API for Service Bus in a SOA
Normalized Message Router API
Container API for deploying Service Engines and Binding Components
◦ Service Engine
◦ Business logic service
◦ Transformation service
◦ Integration of multiple services
◦ Binding Component
◦ Connectivity to external services
◦ Consumer or provider
18. JBI Component interfaces
Component
◦ Lifecycle interface for service units
ServiceEndpoint
◦ Addres of a service
◦ List of interfaces
◦ List of operations
ComponentContext
◦ Callbacks for service units
◦ Get delivery channel: accept/send MessageExchange
◦ Get other ServiceEndpoints
20. ServiceMix JBI Container
Bindings for common Java Technologies
◦ SOAP Bindings: plain HTTP/SOAP, jsr-181, X-Fire, ...
◦ JMS Binding for plain JMS and JMS+SOAP
◦ Quartz scheduler consumer binding
◦ FTP provider and consumer
◦ Bindings for JavaMail, HTTP, RSS, jabber ...
Service Engines
◦ Generic Routing patterns: router, filter, splitter, aggregator, ...
◦ XSLT transformation
◦ Support for BPEL engines: Intalio PXE en Apache ODE
◦ Support for Oracle XSQL
JBI Component Adaptors for POJO’s
◦ Real POJO’s: use reflection
◦ Implement JBI interfaces or use annotations
21. Using ServiceMix
Deployment options
◦ Standalone container with hot-deploy
◦ Bundled with Apache Geronimo J2EE container
◦ JBoss deployer
Spring based configuration
◦ XML namespaces avant la lettre
Code example