Mule and Web Services Dan Diephouse, MuleSource. About Me Open Source: Mule, CXF/XFire, Abdera, Apache-* Exploring how to make building distributed services.

Slides:



Advertisements
Similar presentations
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Advertisements

Integrated Platform version 5.2
Enterprise Java and Data Services Designing for Broadly Available Grid Data Access Services.
MIT Lincoln Laboratory A Service-Oriented Approach to Application Development Robert Darneille & Gary Schorer WPI MQP Presentations ICS Group 10 October.
Web Services Development made easy Olivier Le Diouris Principal Product Manager.
Siebel Web Services Siebel Web Services March, From
Self-Regenerative Middleware Service for Cross-Standards and Ubiquitous Services Activation Mengjie Yu ( )
31242/32549 Advanced Internet Programming Advanced Java Programming
Francisco Gonzalez Mario Rincon.  Apache CXF is an open source services framework.  CXF helps you build and develop services using frontend programming.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
The Next Generation ESB
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
A Talk with Two Titles Well, actually three including this one.
Spring, Hibernate and Web Services 13 th September 2014.
An architecture for webb applications, J2EE
SOA Today with. Agenda SOA defined Introduction to XFire A JSR 181 Service Other “stuff” Questions.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Review For Midterm.
J2EE vs..NET Nigam Patel. Topics Background –Web Services, J2EE and.NET Similarities Differences Conclusion –Pros and Con (J2EE and.NET)
Peoplesoft: Building and Consuming Web Services
Introduction to EJB INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
SOA, EDA, ECM and more Discover a pragmatic architecture for an intelligent enterprise, to maximize impact on the business Patrice Bertrand Software Architect.
Kasun Indrasiri Associate Technical Lead PMC, Apache Synapse Member, Integration MC WSO2 Inc. May 2013 Introduction to WSO2 ESB.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Enterprise Solutions BITEC: Business Integration Platform
SOA, BPM, BPEL, jBPM.
ESB Guidance 2.0 Kevin Gock
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Presented by, MySQL & O’Reilly Media, Inc. Data Services: Mashing and Shredding Data Using XAware.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
CaGrid 2.0 December What is caGrid 2.0??? Provides a patch for caGrid 1.x to support SHA2 OSGi implementation of WSRF on the new technical stack.
Chapter 4: Core Web Technologies
HTTP client wide area network (Internet) HTTP proxy HTTP server HTTP gateway firewall HTTP tunnel Copyright Springer Verlag Berlin Heidelberg 2004.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Integration Broker PeopleTools Integration Broker Steps –Introduction & terminologies –Application Server PUB/SUB services (Application Server)
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
第十四章 J2EE 入门 Introduction What is J2EE ?
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
GT Components. Globus Toolkit A “toolkit” of services and packages for creating the basic grid computing infrastructure Higher level tools added to this.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Agenda 1.Implementation of CustomerService. CustomerService wrapper SOAP → ESB internal format Abstract → Concrete XML syntax ESB internal format → HTTP.
Introduction to ESBs: Mule UC San Diego CSE 294 November 14, 2008 Barry Demchak.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
Tuscany: a SOA framework Jeffrey Guo Accelrys, Inc.
SCA Bindings Simon Holdsworth Piotr Przybylski. Agenda n SCA Bindings Overview l Bindings TC Charter n Bindings l Web Services Binding l JMS Binding l.
XML and Web Services (II/2546)
Enterprise Integration Patterns CS3300 Fall 2015.
INT-9: Implementing ESB Processes with OpenEdge ® and Sonic ™ David Cleary Principal Software Engineer.
Enterprise Java Overview Panos Konstantinidis Java Developer JUG Leader & Java Champion
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Enterprise JavaBeans 3.0. What is EJB 3.0 -Reusable server-side component framework-technology -Designed to support building demanding enterprise – level.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Overview of SOA and the role of ESB/OSB
EJB Enterprise Java Beans JAVA Enterprise Edition
Wednesday, March 16, 2016 PESC + SOA A flexible and distributed SOA architecture to implement the PESC Standard Jam Hamidi
© ScalAgent Distributed Technologies – October Objectweb ESB Initiative ObjectWeb ESB Initiative ScalAgent’s vision and proposal Roland.
J2EE Platform Overview (Application Architecture)
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
WEB SERVICES.
Web Services-JAX-RPC JAX-RPC enables a Web Service endpoint to be developed using either a Java Servlet or Enterprise JavaBeans (EJB) component model.
Java Messaging Service (JMS)
Java Messaging Service (JMS)
Distributed System using Web Services
Enterprise Java Beans.
Distributed System using Web Services
Presentation transcript:

Mule and Web Services Dan Diephouse, MuleSource

About Me Open Source: Mule, CXF/XFire, Abdera, Apache-* Exploring how to make building distributed services more powerful/approachable/scalable/etc MuleSource

Agenda Mule Overview Mule & web services Building web services integration The future

Overview

SOA Swiss Army Knife Supports a variety of service topologies including ESB Highly Scalable; using SEDA event model Asynchronous, Synchronous and Request/Response Messaging J2EE Support: JBI, JMS, EJB, JCA, JTA, Servlet Powerful event routing capabilities (based on EIP book) Breadth of connectivity; 60+ technologies Transparent Distribution Transactions; Local and Distributed (XA) Fault tolerance; Exception management Secure; Authentication/Authorization

Why do developers choose Mule? No prescribed message format XML, CSV, Binary, Streams, Record, Java Objects Mix and match Zero code intrusion Mule does not impose an API on service objects Objects are fully portable Existing objects can be managed POJOs, IoC Objects, EJB Session Beans, Remote Objects REST / Web Services Easy to test Mule can be run easily from a JUnit test case Framework provides a Test compatibility kit Scales down as well as up

Mule Node Architecture

Mule Topologies Mule can be configured to implement any topology: Enterprise Service Bus Client/Server and Hub n' Spoke Peer Network Pipeline Enterprise Service Network

Core Concepts: UMO Service UMO Services in Mule can be any object - POJOs, EJBs, Remote Objects, WS/REST Services A service will perform a business function and may rely on other sources to obtain additional information Configured in Xml, or programmatically Mule Manages Threading, Pooling and resource management Managed via JMX at runtime

Core Concepts: Endpoints Used to connect components and external systems together Endpoints use a URI for Addressing Can have transformer, transaction, filter, security and meta-information associated Two types of URI ?[params] scheme://[address]?[params] jms://my.queue?persistent=true

Core Concepts: Routers Control how events are sent and received Can model all routing patterns defined in the EIP Book Inbound Routers Idempotency Selective Consumers Re-sequencing Message aggregation Outbound Routers Message splitting / Chunking Content-based Routing Broadcasting Rules-based routing Load Balancing

Core Concepts: Transformers Transformers Converts data from one format to another Can be chained together to form transformation pipelines <custom-transformer name="CobolXmlToBusXml" class="com.myco.trans.CobolXmlToBusXml"/> <endpoint address="jms://trades" transformers="CobolXmlToBusXml, XmlToJms"/>

Mule and Web Services

Bookstore Publisher Our scenario Bookstore Service + addBooks + getBooks Bookstore Client Book list (CSV) Buyer Bookstore Client order confirmation

How? Mule provides File connector connector CXF connector Whats CXF? Successor to XFire Apache web services framework JAX-WS compliant SOAP, WSDL, WS-I Basic Profile WS-Addressing, WS-Security, WS-Policy, WS- ReliableMessaging

How? 1. Build web service 2. Configure Mule server 3. Generate web service client 4. Build CSV->Book converter 5. Configure Mule with File inbound router and CXF outbound router 6. Configure Mule with endpoint to confirm orders 7. Send messages to service from bookstore

Quick Intro to JAX-WS The standard way to build SOAP web services Supports code first web service building through annotations Supports WSDL first through ant/maven/command line tools

Building the Web Service public interface Bookstore { long addBook(Book book); Collection addBooks(Collection books); Collection getBooks(); }

Annotating the public interface Bookstore { long Book Collection Collection Collection getBooks(); void long ) }

Data Transfer Objects public class Book { get/setId get/setTitle get/setAuthor }

portName="BookstorePort, endpointInterface="org.mule.example.bookstore.Bookstore" ) public class BookstoreImpl implements Bookstore { … }

Configuring Mule <mule-descriptor name="echoService" implementation="org.mule.example.bookstore.BookstoreImpl "> <endpoint address="cxf:

Starting Mule Web applications Embedded Spring Anywhere!

Main.main() – simplicity MuleXmlConfigurationBuilder builder = new MuleXmlConfigurationBuilder(); UMOManager manager = builder.configure("bookstore.xml");

What happened?

Some notes about web services Be careful about your contracts!!! Dont couple your web service too tightly (like this example), allow a degree of separation This allows Maitainability Evolvability Versioning WSDL first helps this

The Publisher Wants to read in CSV and publish to web service Use a CXF generated client as the outbound router CsvBookPublisher converts File to List Books then get sent to outbound router File PollerCsvBookPublisher CXF Outbound Router

Our implementation public class CsvBookPublisher { public Collection publish(File file) throws IOException { … }

Domain objects are the Messages File Book Title Author Access can be gained to raw UMOMessage as well

Generating a client org.apache.cxf cxf-codegen-plugin incubator generate-sources ${basedir}/target/generated/src/main/java wsdl2java

Our configuration <mule-descriptor name="csvPublisher" implementation="org.mule.example.bookstore.publisher.CsvBookPublisher" singleton="true"> …

Outbound router configuration <property name="clientClass" value="org.mule.example.bookstore.BookstoreService"/> <property name="wsdlLocation" value="

Start it up!

Integration Bookstore Place Order Order (Book, , Address) Order to transformer Object to Message transformer SMTP endpoint

Endpoint Configuration <endpoint name="order Service" transformers="OrderTo ObjectToMimeMessage"> <property name="fromAddress" /> <property name="subject value="Your order has been placed!" />

Transformers <transformer name="OrderTo " className="org.mule.example.bookstore.OrderTo Transformer"/> <transformer name="ObjectToMimeMessage" className="org.mule.providers. .transformers.ObjectToMimeMessage"/>

Sending the Message public void orderBook(long bookId, String address, String ) { // In the real world we'd want this hidden behind // an OrderService interface try { Book book = books.get(bookId); MuleMessage msg = new MuleMessage( new Object[] { book, address, } ); RequestContext.getEventContext().dispatchEvent( msg, "order Service"); System.out.println("Dispatched message to orderService."); } catch (UMOException e) { // If this was real, we'd want better error handling throw new RuntimeException(e); }

Questions? My Blog: Project Site: MuleForge: MuleSource: