service oriented architecture, web services and web 2.0:

43
© Donald F. Ferguson 2008 Service Oriented Architecture, Web Services and Web 2.0: Applications, Infrastructure, Standards Dr. Donald F. Ferguson [email protected] SVP, Distinguished Engineer Chief Architect, CA Products 1/22/2009 1

Upload: zubin67

Post on 14-Jun-2015

469 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Service Oriented Architecture,Web Services and Web 2.0:

Applications, Infrastructure, Standards

Dr. Donald F. [email protected]

SVP, Distinguished EngineerChief Architect, CA Products

1/22/2009 1

Page 2: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 2

Page 3: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 3

We are going toimplement this scenario

andlearn what happens

under the hood.

Page 4: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 4

Page 5: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Course Overview

• Content– Analogous to 1st course in operating systems or compilers.– Approach

• Broad coverage of concepts, architecture and design, etc.• Deep dives for specific topics

– For each topic• Architecture and concepts• Examples of realization• Implementation

• Course Objectives: At the end of this course you should be able to– Build SOA and Web 2.0 solutions.– Have sufficient knowledge to be a technical project leader.– Understand, define and consult on enterprise architecture.

1/22/2009 5

Will adapt rate and pace.I do not know what you know.

I do not know how quicklyyou can absorb the info.

Page 6: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Course Overview

• Content– Analogous to 1st course in operating systems or compilers.– Approach

• Broad coverage of concepts, architecture and design, etc.• Deep dives for specific topics

– For each topic• Architecture and concepts• Examples of realization• Implementation

• Course Objectives: At the end of this course you should be able to– Build SOA and Web 2.0 solutions.– Have sufficient knowledge to be a technical project leader.– Understand, define and consult on enterprise architecture.

1/22/2009 6

Have fun!

If you are not having fun,let me know and we can discuss.

Page 7: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Course Overview• Format

– Lecture with discussion.

– Self-directed reading and research.

• Homework and focus questions will guide research.

• There is plenty of information out there.

• Will provide some pointers.

– Will refine rate, pace and depth based on student feedback.

• Work and Grade– Class participation; shows that you are doing the reading.

– Weekly short paper

• Answering focus questions.

• Top-level design specification for solving problem or question.

– Development projects implementing (some) designs.

1/22/2009 7

Will post slides in advanceto allow you to take notes

on the slides.

Page 8: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Course Overview• Contact Information

– Office hours• 9:30 – 10:30 in the CSB Lounge but confirm first.

• Special arrangements by request.

– Email: I am bad at reading email but• It is the best way to contact me.

[email protected] or [email protected].

• Be patient and persistent.

– Will post slides as well as other material athttp://donald-ferguson.net/blog/?page_id=75.

• Miscellaneous– Will try to avoid canceling class due to business/personal

commitment.

– If I cannot make a class,• We will schedule a make up.

• May use a Web meeting for lecture and add extra office hours.

1/22/2009 8

Page 9: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Your Experience• XML

– XML documents– XML Schema Definition– XSLT, XPath

• Java– J2EE– JDBC, JMS– JAX-WS, JAXB

• Web Services– WSDL, SOAP– WS-Security– BPEL

• Web 2.0– Programmed RSS or Atom– REST– AJAX

1/22/2009 9

Are you familiar with?

Have you read papers, books, specs about?

Have you written programs using?

Page 10: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 10

Page 11: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

ScenarioContoso

Acme Travel

Receive Filter

Transform

Transform

Cancel

New

Hotel

Reservation

Success

Inform

Car

Service

New

Hotel

Reservation

Success

Feed

Contoso• Mid-size insurance company

• Works with independent agents,branches, …

• Relies on Acme Corporate Travel

Acme Travel• Self-service portal

• B2B links to airlines, hotels, etc.

• Internal itinerary mgmt and otherprocesses.

• User identity and profile info.

Page 12: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

A ScenarioContoso Acme

Travel

Receive Filter

Transform

Transform

Cancel

New

Hotel

Reservation

Success

Inform

Car

Service

New

Hotel

Reservation

Success

Feed

We need tohave regional

partner meetings.

Page 13: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

A ScenarioContoso Acme

Travel

Receive Filter

Transform

Transform

Cancel

New

Hotel

Reservation

Success

Inform

Car

Service

New

Hotel

Reservation

Success

Feed

We need to have

a regional partners

meeting.

Small IT staffwants to build

simple, customizable,connected BPs for

meeting mgmt.

Needs to quickly do a POC for entering the convention mgmt business, and thenexpand into production.

Each customer is different.

Flexible deployment and data center model is essential.

Need to enableconnectivity with

people and simpleapps

End Users andSMBs build mashups

or quickmodification to Web sites to go from UI

to API

Page 14: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 14

Page 15: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200815

Complexity – A Pre-SOA Enterprise Solution

Page 16: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200816

Complexity

• Cause

– Multiple protocols and formats.

– Unknown connections between systems.

• Produces an environment:

– Is almost impossible to monitor.

– Problem and performance management is impossible.

– Cannot answer simple questions like• What systems do I need to change if a reengineer app X?

• What systems do I need to integrate a new app Y with?

Complexity

Page 17: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200817

Complexity will get much worse

• Increasing partnerships and multi-organization

• Line-of-business (LOB) and departmental systems drive increased portfolio of apps.

• SOA creates semi-dynamic flexible useof core enterprise services.

• Competition and business opportunitiesdrive rapid change of business processes.

• Innovation by selecting new technology.

Complexity

Page 18: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200818

What is …..?

18

… a service?

A repeatable business

task – e.g., check

customer credit; open

new account

… service orientation?

A way of integrating your

business as linked

services

and the outcomes that

they bring

… service oriented

architecture (SOA)?

An IT architectural style

that supports

service orientation

… a composite application?

A set of related &

integrated services that

support a business process

built on an SOA

Actually a set of

reusable operations

Actually, there are

four styles of

composite application.

Page 19: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Composite Application

1/22/2009 19

Page 20: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Composite Application• “In computing, the term composite application expresses a

perspective of software engineering that defines an application built by combining multiple existing functions into a new application.” (http://en.wikipedia.org/wiki/Composite_application)

• Four Core Styles1. On the glass to provides user, task and skill specific UI page, e.g. portal

services, mashups2. Event/Message driven architectures implement integration between

independent applications and databases, e.g. Enterprise Service Bus, Event Driven Architecture

3. Business processes and workflows that orchestrate the sequence of operations to perform a high layer task, e.g.1. HR product adding an employee to payroll, directory, etc.2. Purchase order processing in enterprise resource planning (ERP) system.

4. Information Integration builds a single schema and data space by merging and transforming information in multiple databases, e.g. generating reports, Business intelligence and data mining

• All solutions are a combination of styles.

1/22/2009 20

Page 21: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Composite Application• “In computing, the term composite application expresses a

perspective of software engineering that defines an application built by combining multiple existing functions into a new application.” (http://en.wikipedia.org/wiki/Composite_application)

• Four Core Styles1. On the glass to provides user, task and skill specific UI page, e.g. portal

services, mashups2. Event/Message driven architectures implement integration between

independent applications and databases, e.g. Enterprise Service Bus, Event Driven Architecture

3. Business processes and workflows that orchestrate the sequence of operations to perform a high layer task, e.g.1. HR product adding an employee to payroll, directory, etc.2. Purchase order processing in enterprise resource planning (ERP) system.

4. Information Integration builds a single schema and data space by merging and transforming information in multiple databases, e.g. generating reports, Business intelligence and data mining

• All solutions are a combination of styles.

1/22/2009 21

Wikipedia references may be incomplete, biasedand/or inaccurate but

are a good place to findreference and pointers.

Page 22: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

SOA and Web Services

• SOA is an architectural style following some principles– Input and output messages completely describe behavior

No private signaling , configuring or shared data.– Coarse grain interactions, unlike OO.– Self-describing, cataloged, well-defined messages– etc.

• SOA “resonates” because many programmers have been doing it for years. SOA codifies a set of best practices for– Message Driven Processing (MQ).– SessionBeans and the Transfer Object Pattern– CICS TP Systems

• Web Services are a set of standards for SOA– Enable interoperability between infrastructure (middleware), and between

different development tools.– Eliminates the need to integrate the infrastructure before integrating business

logic to form new, composite applications.– SOAP/HTTP– WSDL, WS-Policy, specific policy assertions, BPEL4WS

22

Page 23: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Catalog

Inventory

Database

Catalog

Inventory

Catalog

Inventory

SharedData

InterfaceDefinition

Implementation SW

Not SOA

Two SOAApproaches

Page 24: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web Service is SOA + Standards

Web Services Definition by W3C

A Web service is a software application• Identified by a URI

• Whose interfaces and binding are capable of being – Defined

– Described

– Discovered

by XML artifacts

• Supports direct interactions with other software applications– Using XML based messages

– Via internet-based protocols

1/22/2009 24

Page 25: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web 2.0

1/22/2009 25

http://en.wikipedia.org/wiki/Web_2.0

Page 26: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web 2.0

• No one really knows what Web 2.0 is, or more accurately– Everyone thinks they know what it is.

– Everyone’s definition and opinion are different.

• Core set of concepts (which we will cover)– Better UI model than browser/HTML, e.g. AJAX, Silverlight

– REST, or simple HTTP operations

– Feeds (RSS, ATOM)

– Mashups

– Community: Blogs, wikis, tagging, etc.

• This course will focus on application development and execution using Web 2.0.

• The fundamental notion– Does for applications what wikis did for Web pages or Excel did for data.

– End user “programs the Web” to be what he/she wants.

1/22/2009 26

Page 27: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Mapping to Our Scenario

• Acme– Provides a composite application.

• UI for self-service.• Integrates information from airlines, hotels, …• Orchestrates and controls the steps in building an itinerary.• Events to integrate with flight cancellations, synchronize changes with

user calendars, …

– Uses Web services and SOA• Simplify integration• Business-to-business

• Contoso: Meeting coordinator wants to• Move to a mashup interacting with Web addressable systems• To replace Excel spreadsheets, email and phone calls.

• Small and medium businesses want to– Move from UIs and manual tasks for customers– To “REST” callable APIs, feeds, …– To plug into Acme’s solution and enable meeting coordinator mashup.

1/22/2009 27

Page 28: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 28

Page 29: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Today’s Agenda• Course Housekeeping 11:00

– Format– Communication– Student work and grading

• Motivating Scenario 11:15• Introducing the Base Concepts 11:30

– SOA and Web services– Web 2.0– Mapping to the scenario

• Break 11:50• SOA and Web Services 12:00

– Core Concepts– Standards– Implementing a basic Web service

• Discuss 1st Assignment 12:40

1/22/2009 29

Page 30: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200830

SOA/Web Service Concepts

Prolog

Types

Messages

Bindings

Policy

Control Descriptors

Deployment Descriptors

Operations

Port Types

JMS/MQ

HTTP

IIOP

… …Impl.

Stub

• Required Interfaces

• Events

• Policy Points

• … …

ESB

Container

“Resources”

“Abstract Process”

“Business State”

BPEL

C#

CICS TP

JAVA

SQL

… …

Page 31: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

SOA and Web Service Concepts• One way to think about an application is

– Nouns, e.g. customer, itinerary– Verbs, e.g. cancel trip, change seat– Adverbs, e.g. securely, reliably.– Policy, e.g. you cannot make a hotel reservation until you have put a

credit card in your profile.

• SOA/Web Service concepts realize this model. – Interface (Verbs)

• What operations/verbs does the service implement? How do you call it?• Web Service Description Language, BPEL Abstract Process

– Resources (Nouns)• What do I create, retrieve, update, delete (CRUD)?• WS-Transfer, WS-Addressing

– Policy (Adverbs) (Infrastructure Policy)• Attach “policy” to services and verbs.• WS-Security, WS-Reliable Messaging, WS-Policy

1/22/2009 31

Page 32: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

SOA and Web Service ConceptsSOA/Web Service concepts realize this model (cont)

• What is the address and how. – What protocols can the caller use?– The “WS-*” equivalent of US Mail, Fax, etc.– SOAP, IIOP

• Policy (Business Policy)– What

• Constraints, invariants, preconditions, etc.• For verbs and nouns.• They are “changeable”• And should not be hard coded.

– Examples: Design patterns, rule engines, handlers• Container

– The thing that loads and runs my code.– Automates complex tasks that I do not want to write.– Tomcat, Apache Web Server Modules

1/22/2009 32

Page 33: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

SOA and Web Service Concepts

SOA/Web Service concepts realize this model (cont)• Stub and Skeleton

– Stub is a class that I generate from interface for calling service.– Skeleton is a generated class that

• Implements the interface• Has “Your code goes here” for the methods.

– WSDL2Java, .NET Windows Communication Foundation annotations

• Required Interfaces and Events– Sort of like import in Java but– Class documents what it calls– Logically like public class CommerceImpl implements ICommerce

requires com.somecompany.commerce.CreditCardService– Four core Message Exchange Patterns

• In-Out (RPC)• In (I act on a message)• Out (I emit this message)• Out-In (I need someone to implement this verb).

1/22/2009 33

An event.

Required Interface

First project concepts.

Page 34: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Building a Basic Web Service:Your 1st Assignment

• WSO2 – www.wso2.com– Download and install application server.

(http://wso2.org/downloads/wsas).

– Read the tutorials for building a simple Web service.• WSO2 has tutorials

• http://ws.apache.org/axis2/1_4_1/contents.html

• Many Axis2 Tomcat documents on the Web

• Your 1st Project– Define a simple person object, e.g. name, id, etc.

– Implement a POJO Web service for CRUDing a person.

– Write a simple Java client for calling the service.

– Explain the concepts and technology that you used and their relationship (5-6 pages).

1/22/2009 34

Page 35: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Focus Questions

• Compare and contrast “top-down” versus “bottom up”development of POJO Web services.– What are top-down and bottom-up?

– What are the pros and cons?

• Propose and define an email binding (not implement)– How would you add support for invoking the service and receiving the

response by sending email?

– Explain the design.

– What are some of the complexities?

• 2-3 pages for each focus question.

1/22/2009 35

Page 36: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Comments• You may work together

– Make this explicit in your documents.

– Who did what?

– The content of a 3 person team should be at least 2.5 times as much as a 1-person team.

• DO NOT PANIC! DO NOT DROP THE CLASS!– I may be expecting too much.

– This may

• Be too many concepts too quickly.

• Too much work.

– It is OK to come back an say “I failed miserably.”

– My jobs is to teach you how to do this.

1/22/2009 36

Page 37: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web Service Standards (Partial)

1/22/2009 37

Page 38: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web Service Standards

• WS-I– Brings disparate standards into tested, integrated profiles.– Basic Profile (BP), Reliable Secure Profile (RSP)

• HTTP– Protocol for exchanging messages.– Logical “result = cancelTrip(id)” is– Encoded in the POST/GET data.

• XML, XML Schema Definition (XSD)– XML/XSD is how you define itinerary, hotel reservation,

etc.– SOAP is how you serialize/deserialize to a byte[] for

transmission.

• WSDL is like a Java interface definition for XML

1/22/2009 38

Page 39: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web Service Standards (cont)• Endpoint (WS-Addressing, WS-Transfer)

– Where do you send/route the message?– Where do you send the response?– Which itinerary are you canceling?

• Eventing– How does the airline tell the travel agency about a cancelation?– How do I filter which cancelation I want to see?– WS-Eventing.

• Quality of Service– WS-Security:

• How do I know Don sent the message?• How do I know that no one tampered with the message?

– WS-Reliability• Did you get the message?• Do I need to resend it?

– WS-Transaction:• Reserve a flight, car rental and hotel room as a unit.• Tell me if you could not.

1/22/2009 39

Page 40: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 2008

Web Service Standards (cont)• Composition (BPEL, SCA)

– What services make up the travel self service application?

– In which order do I call the verbs to book a trip.

• Management (WS-Management, SMASH, DASH)– The composite application

• Is a set of services/modules.

• Running “in” a set of things, e.g. Tomcat, database

– How do I write code that manages and monitors

• The services (modules)?

• The things in which they are running?

• Portal (WS-RemotePortlet, JSR 168)– My task requires access to five services.

– I want them on “one page”

– How to I define the page and connect to the services?

1/22/2009 40

Page 41: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200841

SOA and Web Service StandardsBusiness Abstraction SOA Abstraction

> Document

> Form

> XML

> WS-* Message

>Requirements >Policy

>Security

>Reliable Messaging

>Process >BPEL4WS

>WS-CoordinationWS-BusinessAgreement

>Business artifacts (customer, account) >XML, XQuery

>“Yellow Pages” >Metadata Exchange

>WS-Discovery

>Workspaces >WS-RemotePortlet

>Portal standards

>Monitoring >WS-Management, WSDM

>Business Events >WS-Eventing

Page 42: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200842January 22, 2009 Japan Java Users

Group – SOA and Components

Implementing a Services

Interface:

How to call

this component

Reference:

What this

components callsJava

Interface

WSDL

Port Type

Java

Interface

WSDL

Port Type

Component

Uniform

Representation of

Encapsulated

Implementation

Business

Process

Business

State Machine

Business

Rule

Human

Task

Interface

MapSelector Java

SQL

XQuery

Policy

IMPL

Page 43: Service Oriented Architecture, Web Services and Web 2.0:

© Donald F. Ferguson 200843January 22, 2009 Japan Java Users

Group – SOA and Components 43

Implementing a Service“Web services describes the outsides. How do you implement a service? How

do you compose services?”

Encapsulate Components for Reuse; All look the same from outside

Components may be wired together and aggregated via flow

Business Objects are the data flowing on wires between Components

Enable type, role and skills specific tools.Interface:

How to call

this componentReference:

What this

components callsJava

Interface

WSDL

Port Type

Java

Interface

WSDL

Port Type

Component

Uniform

Representation of

Encapsulated

Implementation

Business

Process

Business

State Machine

Business

Rule

Human

Task

Interface

MapSelector Java

SQL

XQuery

Policy