1 Programma Webservices en EAI met XML Erica C. Van de Stadt Jan H. Van Lieshout WizWise Technology In samenwerking met PAON Programma Onderdelen Dag ...
\ Intro \ (Web) service: concept en evolutie \ Informatie integratie en conversie met XML \ Service Oriented Architectuur (S0A): simpele R2P variant [ WS stijl message transport [ WS stijl Service interface [ WS stijl ontwikkelen
WizWise Technology
2
1
(Web) Services Context, Concepten Evolutie
(Web) Services Concept, Evolutie
De wonderlijke hype van het concept “Service” •Evolutie van de “machinale” dienstverlening •De gedistribueerde omgeving die steeds sneller en machinaler bespeeld moet worden •De “Web Service” rol in Service Oriented Architecturen Met een beetje andermans wijsheid WizWise Technology
2
Mensen, Machines, Netwerken en Services en hulpbegrippen Role
Component in Role
Collaboration
(WEB) SERVICE!
Framework, Middleware & Container
Interaction (With Information)
Implementation
Operating System
Net
Hardware
WizWise Technology
3
1
(Web) Services Context, Concepten Evolutie
Evolutie van de “ gedistribueerde machinale dienstverlening”
SHIFT
Ad Hoc
2002+
1990’s
1980’s
SHIFT
Hub n’ Spoke, EDI and EAI
XML Integration Services
WizWise Technology
4
(Service Oriented ) Architectuur? Wat is dat?!!! Er is natuurlijk al ruzie met de echte “Architecten”
Een kleine filosofische vrede vragende definitie voor deze cursusduur: “Architectuur bemoeit zich met de structurele aspecten (I.t.t. de contingente aspecten) van een fenomeen.” =>”kleur” en “dakpannen” vallen er buiten. (zitten we tenminste direct in een filosofische discussie…)
WizWise Technology
5
2
(Web) Services Context, Concepten Evolutie
Architectuurkenmerken voor “dienstverlenende “IT” machinerieen? (en meteen drie historische SOA klassen verkregen?)
ARCHITECTURE
MAINFRAME
CLIENT/SERVER
SERVICEORIENTED
PLATFORMS
Monolithic and centralized
Homogeneous and controlled
Diverse and unpredictable
NETWORKS
Limited and closed
LANs emerging but isolated
Internet ubiquitous and interconnected
DATA FORMATS TECHNOLOGY FOCUS
Opaque and inaccessible
Binary and proprietary
Semantic and shared
Operating system
Database
Interface
USERS
IT operators
Departmental employees
BUSINESS VALUE
Digitization of datacentric operations
Putting data in hands of business users
Suppliers, employees, and customers Enabling business agility and collaboration
WizWise Technology
6
Verfijning van de “service oriented architecturen IT machinerien” SOA PILLAR
APP SERVER
EAI HUB
WEB SERVICES
No. Application server maintains highly centralized model of resource management.
Partial. Applications connected to hub may be widely dispersed. Integration hub itself remains centralized.
Yes. Web services infrastructure is highly distributed.
Partial. Components in server are tightly coupled to container, but public interfaces may be more flexible.
No. Traditional integration mechanisms are very tightly coupled and thus quite brittle.
Yes. Interfaces among services and between layers of stack loosely coupled.
StandardsBased
Partial. Internal architecture (J2EE) is multi-vendor. Most app servers adopting some implementation of web services for external component interfaces.
No. EAI hubs rely upon costly, proprietary adapters and a closed internal architecture, although "wrapping" interfaces will increase interoperability.
Yes. Premise of loosely coupled layers depends upon broad support for standards internally and externally.
ProcessCentric
No. Applications conceived as whole. No architectural basis for rules-based exception handling.
Yes. Increasingly focused on providing means for business process management.
Distributed
Loosely Coupled
WizWise Technology
Yes. Services conceived as tasks and assembled through orchestration.
7
3
(Web) Services Context, Concepten Evolutie
Vraag en nut de gedistribueerd IT services oplossingen Vanuit een business perspective kun er niet omheen. Door alle lagen heen business, activiteiten, bronnen en informatie integreren: BPI (zie Microsoft claim)
WizWise Technology
8
What Is Business Process Integration?
Business Process Integration, or EAI, is a software solution that allows businesses to integrate internal applications, securely connect with business partners over the Internet, and automate business processes.
Courtesy Microsoft 2002
WizWise Technology
9
4
(Web) Services Context, Concepten Evolutie
Creating Competitive Advantage Get ahead of competitors by ensuring you’re using all of your data to make smarter decisions, faster z
AMR Research estimates that less than 10% of enterprise processes are integrated in a dynamic framework that allows a company to respond to changes in market conditions
– AMR Research “The Report on Enabling Technologies” April 2001 z
Without BPI a business faces: ¾ Lost revenue opportunities ¾ Increased cost of doing business ¾ Competitive disadvantage To build and maintain business value, an organization must respond to today’s business imperatives:
z
Reduce process cycle times
z
Make better decisions faster
z
Leverage dynamic business relationships
z
Quickly respond to customer demands
z
Effectively respond to competitive threats
Courtesy Microsoft 2002
WizWise Technology
10
De “Ideale” Onderneming (aldus MS) Connected Customers
z z z z
Web Presence Marketing Commerce Customer Service/CRM
Desktop Productivity, Collaboration Employee Portals Business Intelligence Mobile Solutions
IT Infrastructure Common Application Services Common Data Model WizWise Technology
11
5
(Web) Services Context, Concepten Evolutie
En de realiteit (If you’re lucky) Customers
Partners
ERP
Customer Service
Employees
Human Resource
Financial Services
Supply Chain
Courtesy Microsoft 2002 WizWise Technology
13
BPI Basis probleemgebieden in een “Enterprise Environment” Typical Enterprise
Business Partners
Custom Business Applications
Inventory/ Logistics
Security Firewall
Supplier
EDI
XML
Financial Systems
Supplier hub
xCBL
Customer Relationship Management
EAI WizWise Technology
Enterprise Resource Planning
Marketplace
B2B
Courtesy Microsoft 2002
14
6
(Web) Services Context, Concepten Evolutie
De motivatie voor “Business Process Integratie” nog eens op een rijtje: Business Drivers for B2B
Business Drivers for EAI z
Automated touch points between partners’ business processes
Conformity to business process structures
z
Conformity to partners’ organizational and business process structures
z
Transaction-focused orders
z
z
One-time data entry
Document-focused business transaction (e.g., purchase order)
z
Real-time, automatic response
z
No data entry
z
Centralized business rules
z
Fast, reasonable response
z
Protection of information
z
Notification only when something doesn’t work
z
Protection of information
z
Automated business processes
z
WizWise Technology
15 Source: EAI Journal August 2001
Waneer mogen we onze Services “web service” noemen? Wat karakteristieken
7
(Web) Services Context, Concepten Evolutie
Webservice karakteristieken Open text-based standaarden Gemakkelijk en goedkoop te implementeren \ Maakt gebruik van bestaande infrastructuur (HTTP, TCP/IP) \ Software hergebruik: wrapping legacy applications, software components \ Incrementele ontwikkeling development
Belofte: Reductie van de kosten voor EAI and B2B
WizWise Technology
17
Web Services scoren uiteraard op de “service pilaren” (van de Stencil Group)
Architecure Protocol [ een XML protocol voor het op een server aanroepen van “methods” voor
de uitvoering van een bepaalde operatie en het krijgen van een reactie in XML \ UDDI (Universal Description Discovery and Integration) [ UDDI servers bieden een “telefoonboek” van beschikbare services en
service providers [ UDDI servers kunnen worden geraadpleegd via SOAP
\ WSDL (Web Service Description Language) [ beschrijvingen van de webservice interface
WizWise Technology
19
WS standaarden tesamen: “WS Technology Stack” Vertical Language
Vertical Language
Vertical Language
Vertical Language
Web Service Technologies: SAOP, WSDL, UDDI Horizontal XML Vocabularies: ebXML, RosettaNet Core XML Processing: XML, Schema Web Framework: HTTP, FTP, SMTP, TCP/IP
WizWise Technology
20
9
(Web) Services Context, Concepten Evolutie
Referenties/verantwoording [ www.stencilgroup.com/ • Met name: ideas-scope-200304_evolution.html
“XML als open-standaard formaat en 'intermediate language'”
Basis rol van XML in Webservices
XML
XML
Web Service Composition & Orchestration Technologies:
Vertical Language
Vertical Language
WSCI, BPEL,... Web Service Technologies:
Horizontal XML Vocabularies:
ebXML, RosettaNet
Core XML Processing:
Web Framework:
WizWise Technology
SOAP, WSDL, UDDI
XML, Schema
HTTP, FTP, SMTP, TCP/IP After: Courtesy Sun Microsystems
XML
XML XML
XML 2
1
xml, informatie- integratie en conversie
Waarom XML in Webservices? Webservices wensen: \ Interoperabiliteit tussen heterogene platformen • Schaal, programmeertalen, encoding, snelheid, omvang, datainterpretatie etc etc.verschillen.
[ => encoding, syntax en semantiek van informatie representaties (“documenten”) verschilt!
\ Herbruikbare en simpele gereedschappen • Noodzakelijk voor snelle inzetbaarheid en succes
Oplossing: \ Simpele, flexibele, open standaard voor informatie representatie: [ =>
XML
WizWise Technology
3
XML in vogelvlucht
“Welke problemen worden opgelost met XML en Wat is XML”
2
xml, informatie- integratie en conversie
Problemen die noden tot XML \ “Incompatibele data formaten resulterend in Interoperabiliteit problemen: herbruikbaarheid data laag, uitwisseling data gecompliceerd” \ Data bestaan los van een applicatie [ Data opmaak verweven met een bepaalde toepassings applicatie voor ogen
HTML voor web browsers Binair bericht (binair) voor EDI applicatie Database dumps (tabellen) voor bepaalde database Etc.
\ Data gevangen in een bepaalde applicatie Allerlei software pakketten WizWise Technology
XML Oplossing:
5
Interoperabiliteit
Door XML Kunnen Allerlei Verschillende Apparaten Met Elkaar Communiceren
WizWise Technology
6
3
xml, informatie- integratie en conversie
XML Oplossing: Informatie Behoud XML Redt Informatie Uit De Greep Van Verouderde Technologieën
WizWise Technology
7
Wat Is XML ? XML is een extensible markup language \ Een uitbreidbare markup taal waarin nieuwe betekenisvolle markup talen gedefinieerd kunnen worden \ Een taal die gebruikt kan worden om markup talen(“subtalen”) te definiëren
ÎXML geeft een syntax voor een zelf te definiëren tag-set’s met bijbehorende zelf te bedenken semantiek
ÎVergelijk: HTML (hyper text markup language) een mark-up taal met een vaste tag-set en bijbehorende vaste (presentatie) semantiek
WizWise Technology
8
4
xml, informatie- integratie en conversie
XML Illustratie van de syntax
Tile
Structuring XML documents
books
XML books book
book
<notes> Boek geschikt voor ontwikkelaars
title
notes
title
Structuring XML documents
XML IE5
XML IE5
Boek geschikt voor ontwikkelaars
WizWise Technology
9
XML gerelateerde standaarden \ Document Type Description (DTD) [ Beschijft de structuur van XML documenten
\ XML Schema [ Idem
\ eXtensible Style sheet Language for Transformations (XSLT) [ Beschrijf XML transformaties
\ Document Object Model (DOM) en Simple API for XML (SAX) [ Application Programming Interfaces (API's) voor XML manipulations
WizWise Technology
11
5
xml, informatie- integratie en conversie
XML en Toepassingsgebieden \ Uitwisselformaten • B2B informatie uitwisselen (BizTalk, SOAP) • ...
\ Meta data • Metadata syntax (w3c’s RDF) • Filtering en content selection (w3c’s PICS) • New Feeds (RSS), ...
\ Mobile web • Web content voor mobile devices (WAP/WML)... WizWise Technology
12
Web standaarden Ontwikkeling \ Ontwikkeling onder leiding van het World Wide Web consortium (W3C)
Niet gedreven door specifieke produkt leveranciers / ontwikkelaars
WizWise Technology
13
6
xml, informatie- integratie en conversie
W3C: XML Ontwerp Doelen \ Open web-standaard formaat \ Leesbaar zijn voor mens en machine \ Platform onafhankelijk \ Simpel \ Medium neutraal \ Uitbreidbaarheid !!
WizWise Technology
14
XML: W3c Standaardisatie Proces \ Zie w3c (www.w3c.org)
[ Standaardisatie proces (working groups) • Notes • Working drafts • Candidate recommendations • Proposed recommendations • Recommendations
WizWise Technology
15
7
xml, informatie- integratie en conversie
XML en Open Standaarden Accelerating the adoption of industry standards
Core Technology Standards
The XML Industry Portal
IBM alphaWorks
100+ member companies including IBM, Sun, Microsoft, Corel, Software AG, and Oracle
Sponsored by IBM, Sun, Oracle, SAP, ... A vendor-neutral XML schema clearinghouse. Info on how to apply XML in industrial and commercial settings
Providing early access to emerging technologies to developers
Creating a Single Global Electronic Market WizWise Technology
United Nations Centre for the Facilitation of Procedures and Practices for Administration, Commerce and Transport
extra
16
Waar gaat XML naar toe
Gartner Group "Hype Curve": 4Q2000 WizWise Technology
17
8
xml, informatie- integratie en conversie
General XML Resources \ ibm.com /alphaworks [ site for free emerging tools and technologies from IBM
\ ibm.com/developer/xml [ XML Zone on developerWorks - resources for customers and developers on the use of XML
\ xml.apache.org [ open source XML tools from Apache Software Foundation
\ www.w3.org [ XML base technical standards
\ xml.org [ XML standard vocabularies repository
\ xml.org/xmlorg_news/index.shtml [ new and news (the Cover pages) WizWise Technology
18
XML syntax “basis” in vogelvlucht
“Een uitbreidbare (document/boodschap) standaard geschikt voor combinatie van 'verschillende' documenten”
9
xml, informatie- integratie en conversie
XML doc
Elementen en Attributen \ Elementen [ Begin tag: [ Inhoud: “data string” [ End tag :
mastering xml [ empty-element tag: <participate/>
\ Elementen kunnen attributen hebben: [ A.Noniem
WizWise Technology
20
Element Nesting Een start-tag van een nieuw element mag pas beginnen na het end-tag van zijn “ouder”-element Correct:
Incorrect:
Structuring XML documents
Structuring XML documents <notes>
<notes>
Boek geschikt voor ontwikkelaars
Boek geschikt voor ontwikkelaars
Vergelijk HTML waarbij deze eis niet geldt Correct HTML en incorrect XML: …. Bold text, met bold-italic gevolgd door plain itialic text … WizWise Technology
21
10
xml, informatie- integratie en conversie
“Well-formed” \ Alle XML documentendie aan de XML syntax specifictie voldoen zijn well-formed XML documenten \ Deze documenten bestaan uit een simple hierarchische boomstructuur van ouder-kind relaties met 1 “document element” root \ Deze documenten kunnen worden gebruikt zonder explicite structuurbeschrijving in de vorm van een Schema of DTD
WizWise Technology
22
Tag Names “name” v.s. “prefix:name” notatie Simpele “name” notatie \ simple Tagnaam eisen: • enkel woord, geen whitespace, geen ‘,’,geen “:”, UTF-8 code • hoofd en kleine letter gevoelig
voorbeeld:
Uitbreiding: “prefix:name” \ gebruik t.b.v. Namespace mechanisme \ Tag bestaat uit “ns-prefix” + “:”+”simple name” [ eis: “ns-prefix” moet via in het xml document gedeclareerd worden
voorbeeld: <wwt:title>
WizWise Technology
23
11
xml, informatie- integratie en conversie
Namespaces (1 van 4) Namespace \ Prefix van XML tags \ Zorgen voor de uniciteit van de XML elementen voorbeeld: <wwt:title>
Waarom? \ Noodzakelijk voor het voorkomen van naam conflicten bij het processen van XML documenten met verschillende DTD’s / Schema’s \ voorbeelden: in xslt stylesheets en rdf
WizWise Technology
24
Namespaces (2 van 4) \ Is jouw “Titel” hetzelfde als mijn “Titel” ?
XML doc A ... XML IE5 ...
WizWise Technology
XML doc B ... Jansen Prof ...
25
12
xml, informatie- integratie en conversie
Namespaces (3 van 4) Is jouw “Titel” hetzelfde als mijn “Titel” ? A: ... <wwt:title> XML IE5 ... B:
... Jansen Prof ... WizWise Technology
26
Namespaces (4 van 4) Is jouw “Titel” hetzelfde als mijn “Titel” ? A& B: ... <wwt:title> XML IE5 ... Jansen Prof ...
WizWise Technology
27
13
xml, informatie- integratie en conversie
Processing instructions Aanwijzingen voor de applicatie die het document gaat verwerken Syntax:
target: applicatie of object waarop de instructie van toepassing is instruction: applicatie of object waarop de instructie van toepassing is
WizWise Technology
28
Document type definition - DOCTYPE declaratie Beschrijving van de structuur van het XML document intern Syntax:
… ]>
extern Syntax:
WizWise Technology
29
14
xml, informatie- integratie en conversie
XML en Semantiek (1 van 2) ? XML levert alleen een SYNTAX !! Idee Idee over de BETEKENIS Idee over inhoud van de Mark-up over data/document (“content”) structuur
write
XML doc
BETEKENIS Read inhoud?OK
read
WizWise Technology
30
XML en Semantiek (2 van 2)? Ten behoeve van informatie uitwisseling moeten afspraken gemaakt worden over de “betekenis” van de tags Idee Idee over inhoud Idee over de betekenis over data/document (“content”) van de Mark-up structuur
write
Kennis van de betekenis inhoud OK van de Mark-up
read XML doc
Begrip van de inhoud van het document WizWise Technology
31
15
xml, informatie- integratie en conversie
DTD en XML Schema in vogelvlucht
“Hoe zijn XML documenten opgebouwd:” vastleggen van subcategorieen van documenten (ook wel: “vocabularies”, “grammars”, “xml-(sub)talen, “xml-standaarden”, “xml-applicatie talen”,...)
DTD en/of Schema in Webservices \ Syntax van alle gebruikte “standaarden” in de Webservices wereld is (in meer of mindere mate) vastgelegd m.b.v. Schema's of DTD's [ Er zijn: SOAP, WSDL,UDDI, BPELWS, BPM,... WS-xyz DTD's en/of Schema's
\ Op velerlei plekken worden de gemanipuleerde “data” (bijv. “parameters” van een “operation”) ter plekke beschreven m.b.v. Schema's
WizWise Technology
33
16
xml, informatie- integratie en conversie
DTD/ Schema
DTD/Schema’s - Functie
Voor automatische informatie verwerking moet (meestal) de structuur van de “uitwisseltaal” bekend zijn
Idee over data/document tags,structuur, betekenis en inhoud
data/document structuur OK XML doc
write
DTD/ Schema
read
WizWise Technology
DTD (Document Type Definition)
34
DTD/ Schema
\ Definieert (door middel van een grammatica) de structuur voor klasse van XML documenten [ Welke tags mogen worden gebuikt binnen ander tags [ Welke tags zijn verplicht of optioneel [ ...
\ Te gebruiken als (flexibel) template voor bij het creëren van XML documenten \ Noodzakelijk voor (validating) XML parsers \ Is beschreven in een eigen (SGML) syntax
Schema Functie als bij DTD, maar verschil: \ typeert naast element structuur van XML ook de content (values) van de elementen \ Is beschreven in een XML syntax! \ Nieuwere standaard Online resources: Primer: www.w3.org/TR/xmlschema-0 Structure: www.w3.org/TR/xmlschema-1-…. Datatypes: www.w3.org/TR/xmlschema-2-…. WizWise Technology
37
18
xml, informatie- integratie en conversie
W3C Schema datatype (1 van 3) Complexe types Element definitie bestaande uit elementen en attributen: <element ref = “FirstName” minOccurs=“1” maxOccurs=“1”/> <element ref = “LastName” minOccurs=“1” maxOccurs=“1”/> <element name=“FirstName” type=“string”/> <element name=“FirstName” type=“string”/> Afgeleide types Type definitie is een verfijning van een reeds gedefinieerd type: <simpletype name=“FormalPersonName” source=“PersonName” deivedby=“extension”> <element name =“title” type=“string”/> WizWise Technology
38
W3C Schema datatype (2 van 3) Attribuut definitie
Element met attribuut <element name=“Prise” type=“fixed.14.4” content=“textOnly”>
WizWise Technology
39
19
xml, informatie- integratie en conversie
W3C Schema datatype (3 van 3) Simple type definition Element definitie gebruikmakend van “build-in” data-type: <element name=“Age” > <simpleType> <simpleType name=“Integer4“> <maxlenght value=“4”/> WizWise Technology
Schema Syntax: “in-line documentation” <element name="books"> <documentation> “books” contains a list of “book” element one required “title” attribute usage: course example <documentation> <sequence> <element ref="book" minOccur="1" />
WizWise Technology
43
21
xml, informatie- integratie en conversie
XML document structuur \ XML documenten moeten “Well-formed” zijn [ Strikt hiërarchische structuur van tags: geen overlappende paren van start en stop tags
\ XML documenten kunnen “Valid” zijn [ de inhoud van een valid XML document houd zich aan de regels van een Document Type Definitie (DTD) of Schema
WizWise Technology
44
Combinatie en conversie van XML documenten: “XML processing”
“manipuleren van XML documenten: Extraheren, combineren, modificeren en converteren naar nieuwe vormen”
22
xml, informatie- integratie en conversie
Data conversie met behulp van XML Sources
XML doc
Converteer
Well-formed & Valid
Van type Info Struct.
gebruikt
XML converter
DTD gebruikt
WizWise Technology
47
XML Processing – DTD based een processor kan alle dtd-valid documenten verwerken!
XSLT in Webservices Typische rol van XSLT gebruik in WS: \ In integratie servers, converteer “operaties”, “parameters” en data(“documenten”) tussen verschillende (via services verbonden) applicaties. [ Typisch in “Hub and spoke” architectuur
\ In database adapter (wrapper t.b.v. Ws connectie): conversie van “db eigen” tabel structuur naar in ws service gebruikte xml vocabulary . [ Bijv. Db structuur naar OFX (financieel) strucuur [ Biijv. Uml repository document naar XMI
XSLT(eXtensible Stylesheet Language for Transformations): een taal voor het transformeren van XML documenten naar andere XML documenten
XSL T
FO
Xpath
FO (Formatting Objects): een taal voor het specificeren van“formattering” (presentatie) semantiek
Xpath: een “taal” om delen uit een XML document te selecteren WizWise Technology
51
XPath \ XPath (www.w3.org/TR/1999/PR-xpath-19991008) [ Selectie van (verzamelingen) XML Elementen/attributen • Syntax lijkt sterk op de Unix directory adressering • plus expressies
[ Onderdeel van XSLT [ Gebruikt in veel XML Query talen
WizWise Technology
52
25
xml, informatie- integratie en conversie
XSLT (1 van 4) \ Transformaties worden gespecificeerd als regels: templates \ Templates transformeren XML Elementen (en/of attributen) van een input XML documenten naar een of andere output documenten (XML, HTML, PDF, …)
WizWise Technology
53
XSLT (2 van 4) XML “input tree” title XML books
title
“apply templates”
books
book notes
HTML BODY
book title
XML Structuring XML documents IE5 Boek geschikt voor ontwikkelaars
WizWise Technology
HTML “output-tree”
H1
p
Structuring XML documents
H1
XML IE5
Boek geschikt voor ontwikkelaars
54
26
xml, informatie- integratie en conversie
XSLT (3 van 4) <xsl:template match= “book” >
<xsl:value-of select=“./title”>
title XML books
book title
HTML
books
BODY
book
notes
H1
title
XML Structuring XML documents IE5 Boek geschikt voor ontwikkelaars
Client versus Server side processing \ Client side processing [ de client heeft XML processing software nodig [ de end-gebruiker bepaald de presentatie [ de semantische markup is beschikbaar voor de client Ógebruikt in: intranet en extranet
-
\ Server side processing [ de client heeft geen XML processing software nodig [ de server doet de processing en “serves” geformatteerde data naar de client [ de semantische markup is niet beschikbaar voor de client Ótypische voor internet
XML Processing – multi output formats slecht een processor per output format nodig! “Structuur beschrijving”
XML doc 1 XML
X2o-XML Processing X2o-XML Processing X2o-XML Processing XML processor
“Output 1.txt” “Output 2.txt”
“Output 3.txt”
doc 2 XML doc 3
WizWise Technology
X2h-XML Processing X2h-XML Processing X2h-XML Processing XML processor
“Output 1.html” “Output 2.html” “Output 3.html”
62
30
xml, informatie- integratie en conversie
XML/XSL & Transcoding
WizWise Technology
63
Questions?
WizWise Technology
65
31
Service Oriented Architectures: the "simple" variants
Service Oriented Architecture: the “simple variant” WizWise Technology
1
Prototypical “Simple SOA”Examples The single, short, interaction of a Client to \ get from the Service some Information (“data”) [ Eg: Translation service, Weather Service, …. [ Digital ebooks, mp3’s, …. [ ….
\ Or Control devices at the service side [ Remote house control, ….
\ Or to start up some physical process at the server side, in order to receive later via an other channel material stuff [ Eg: book, CD, … ordering [ Auctioning, [ “dog exerciseservice”
Many Consumer to Business (C2B) are somehow this category? WizWise Technology
3
1
Service Oriented Architectures: the "simple" variants
Collaboration in Simple SOA : “Consuming a Requestor-Provider known service” Service Provider
Service Requestor
Request/Response messages Typically a 2 party game WizWise Technology
4
Apparent “Atomicity” of Simple SOA: - the service seems opaquely done Service Requestor
Service Provider
Processes the request by calling (local) applications, and sending the results as response
WizWise Technology
5
2
Service Oriented Architectures: the "simple" variants
“Architecture” of simple Service Architectures in short Multi perspectives (Role, Composition, Transaction) \ Collaboration role structure: [ Two party interactions
\ Composition structure: [ Atomair (P solves respons without using secondary WS's)
\ Transaction structure: [ Synchronous (2party) • “Very” simple if requester keeps just waiting until he gets the respons (“blocking wait”)
[ Statefull • Messages can be sent and/or received in any order
[ Asynchronous (2party) • Necessary for services with payage or logistic and other phyiscal processes
WizWise Technology
6
Simple SOA: “Web Service” style variant
WizWise Technology
7
3
Service Oriented Architectures: the "simple" variants
Web Service characteristics must be obeyed (Simple) atomic actions as base parts [ Information retrieval in a stateless message exchange, such as a stock quote Web Service
Loosely coupled [ Service consumers and service providers know nothing about each other's underlying implementation
Self-describing [ Standard descriptions exist for these services
And especially obey the … (next slide)
WizWise Technology
8
“Technology stack” Webservice style
Web Service Composition & Orchestration Technologies:
Vertical Language
Vertical Language
WSCI, BPEL,... Web Service Technologies:
SOAP, WSDL, UDDI
: ebXML, RosettaNet
Horizontal XML Vocabularies
:
Core XML Processing
Web Framework:
WizWise Technology
XML, Schema
HTTP, FTP, SMTP, TCP/IP After: Courtesy Sun Microsystems
9
4
simple soa - web service style message transport
XML for distributed message-based communication in Web service style
Simple Object Access Protocol (SOAP) \ SOAP aka: Service-Oriented Architecure Protocol [ Interoperable communication amoun computer systems in a decentralized, distributed network • Platform and language independent communication between computer programs [ The protocol specifies a XML messaging framework – a software system that enables computers to communicate with one another by exchanging XML messages [ SOAP messages specify to a webservice wich operation to invoke and what parameters to bind [ SOAP extensibility allows for: • Attachments, security, routing information and transactions WizWise Technology
3
SOAP: Four main Specification parts \ SOAP envelope [ Describes the format of the SOAP message \ Encode Data Types [ Describes the structure and representations of informtion that are sent in a message \ SOAP remote procedure calls [ A request to execute a program component on a remote computer \ SOAP binding framework [ Describes the protocols through which soap messages ar transmitted to applications
WizWise Technology
4
2
simple soa - web service style message transport
SOAP Message structuur \ SOAP defines [ “envelop” and “body” and “header”
Namespace and schema
Soap envelop
Soap header
Optional: routing security
Soap Body
Content of the message Application specific XML
WizWise Technology
5
SOAP Message Exchange Model \ Describes how a SOAP sender and a SOAP receiver exchange and proces messages
SOAP one-way transmission model
SOAP request/response transmission model
WizWise Technology
SOAP sender
SOAP sender processes the Response
SOAP message
Request Response
SOAP receiver processes the XML message
SOAP receiver processes the Request 6
3
simple soa - web service style message transport
Request/Response models \ Synchronous [ Sender sends a message and starts a “waiting process” [ Receiver listens to the sender, receives the message and responds to the sender ('s waiting process) • Telephone conversation
\ Asynchronous [ Sender sends a message to the receiver and continues with his business [ Receiver checks for incoming messages/receives the message, processes the message, do other things, then respond to the sender • (E-)mail conversation
Web Serivice Description Language (WSDL): Interaction Defines Web services as \ A stateless interaction model \ Individual peer-to-peer message exchanges (synchronous or asynchronous) Service Requestor
Service Provider
SOAP Request/Response messages WizWise Technology
WSDL: “Usage” \ Used by component desingers to specify software interfaces \ Used by development tools to create interfaces to webservices \ Used in the process of publishing and searching a webservice \ Used by client application to invoke the service
Example: Trader.wsdl – service and port ... <service name="Trader"> <documentation> stockhandling.ws.Trader web service <port name="TraderSoap" binding="tns:TraderSoap"> <soap:address location="http://192.168.2.111:8003/soap/trader"/> WSDL: service -> binding implementaion
\ Web Services Description Language (WSDL) 1.1 [ W3C Note 15 March 2001
WSDL Toolkit on: \ http://www.alphaworks.ibm.com/tech/wsdlexplorer \ ibm.com/alphaworks [ A set of tools that allow developers to generate client and server code from a WSDL document
WizWise Technology
6
Simple SOA WS style: develop on a "SoapWebserver" platform
SOA-simple WS style: further characteristics -Implementation -Development life Cycle -…
Simple Web Service : 2 party, p2p “Consuming a known service” Implementation example
Service Requestor
Service Provider HTTP server SOAP proxy
SOAP Request/Response messages
? Underlying implementation
WizWise Technology
2
1
Simple SOA WS style: develop on a "SoapWebserver" platform
Simple Web Service : Implementation example: GLUE example Service Requestor
Service Provider HTTP server
GLUE runtime proxy
SOAP proxy IServerXYZ (wrapper) class
GLUEGLUEGLUE: Simple SOAPWebServer Proxy framework to deploy java classes as Webservices
User made wrapper class User java class (application)
XYZ (application) class
WizWise Technology
3
Development Life Cycle –GLUE platform example: Server side legacy conversion
4.Deploy (ie,
2. Get SWS
run it all)
platform (e.g. GLUE) installed
HTTP server
HTTP server SOAP proxy
3. Write the
SOAP proxy
“wrapper” modules
IServerXYZ (wrapper) class
1. Select the legacy application
XYZ (application) class
WizWise Technology
XYZ (application) class
IServerXYZ (wrapper) class
XYZ (application) class
GLUE runtime proxy User made wrapper class User java class (application) 4
2
Simple SOA WS style: develop on a "SoapWebserver" platform
Development Life Cycle –GLUE platform example: Client side development (java+GLUE case) 1. Inspect/analyze
4. Get your client platform plus toolkit (esp. wsdl2java utility)
your prototype client application.
callXYZ (examplar application that needs to call the service XYZ)
SOAP proxy
http://…./xyz
HTTP server
wsdl2java
SOAP proxy
2. Find url of the
5. Generate interface and dummy XYZclient with utility from the wsdl file
/** * An interface for buying stock. */ public interface ITrader {
/** * Purchase the specified stock. * @param quantity The number of shares to purchase. * @param symbol The ticker symbol of the company. * @throws TradeException If the symbol is not recognized. * @return The cost of the purchase. */ float buy( int quantity, String symbol ) throws TradeException; } WizWise Technology
9
Trader Legacy application- Buy.java // import Trader from the library import stockhandling.legacy.ITrader; import stockhandling.legacy.Trader; public class Buy { public static void main( String[] args ) throws Exception {
// create new local Trader class object ITrader trader = new Trader();
// invoke the buy method on the local object float ibmCost = trader.buy( 54, "IBM" ); System.out.println( "IBM cost is " + ibmCost );
// try out on bad value for symbol // float tmeCost = trader.buy( 32, "TME" ); // System.out.println( "TME cost is " + tmeCost ); } } WizWise Technology
10
4
Developping a Simple WS on GLUE platform: DEMO "Trader"
Develop Trader server \ Start with [ Legacy sources: • Trader.java • ITrader.java • (TradeException.java)
\ Inspect ITrader.java and adapt to local uses: [ put it in our myfirm.clients package [ see that it needs a TradeException class, add this class to myfirms.clients package or replace with normal Exception [ [develop]$ edit Itrader.java
\ WRITE a usefull local client --> TraderClient.java [ [develop]$ edit TraderClient.java
// get the interface from our locally compile definition //import myfirm.clients.ITrader; public class TraderClient { public static void main( String[] args ) throws Exception {
// the URL of the web service WSDL file String url = "http://localhost:8003/soap/trader.wsdl";
// read the WSDL file and bind to its associated web service ITrader trader = (ITrader) Registry.bind( url, ITrader.class );
// invoke the web service as if it was a local object float ibmCost = trader.buy( 54, "IBM" ); System.out.println( "IBM cost is " + ibmCost ); float tmeCost = trader.buy( 32, "TME" ); System.out.println( "TME cost is " + tmeCost ); } } WizWise Technology
18
8
Developping a Simple WS on GLUE platform: DEMO "Trader"