Transcript Lesson 1
Une (brève) Introduction aux Web Service Les illustrations présentées en quelques-unes de ces slides sont Copyright Springer Verlag Berlin Heidelberg 2004. Elles ont été fourni directement par les auteurs aux buts didactiques/seminariels 14 Dicembre 2006 Rabat (Marocco) 1 (naive) Business-to-Business Integration web serveur client demandes acquisition interne infrastructure interne fournisseur infrastructure interne Interactions B2B se passent à travers l'accès aux pages Web (en compilant form Web) ou à travers l'email 14 Dicembre 2006 web serveur infrastructure Interne warehouse Rabat (Marocco) [ACKM04] 2 Web Service: l’Evolution du Middleware warehouse middleware for supplier-customer interaction middleware for supplier-warehouse interaction middleware for supplier-XYZ interaction another party (XYZ) middleware for supplier-ABC interaction supplier’s adapters supplier’s adapters fournisseur middleware for integrating the middleware client supplier’s adapters yet another party (ABC) internal infrastructure [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 3 Web Service: l’Evolution du Middleware wide area network (Internet) Web service Company A (provider) Web service client middleware middleware internal service Company B (client) internal service internal service internal service [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 4 (WS-based) Business-to-Business Integration Langages et protocoles standardisés, en éliminant la nécessité de différents middleware (Il est seulement nécessaire le middleware pour Web Service) customer internal procurement requests Web service internal infrastructure Web service supplier internal infrastructure Protocoles d'interaction reprojetés de façon à être peer-to-peer Web service [ACKM04] Fonctionnalités internes rendues disponibles comme services 14 Dicembre 2006 warehouse internal infrastructure Rabat (Marocco) 5 Deux Architectures (et Middlewares) (1) Company D (client) Company A (provider) Web service client Web service interface Web service Logic for accessing to internal systems internal architecture & middleware internal service logic [ACKM04] 14 Dicembre 2006 internal service logic Web service Web service external architecture & middleware Web service Company C (provider) Web service Company B (provider) Rabat (Marocco) 6 L’Architecture Interne other tiers service interface integration logic middleware service interface service interface integration logic integration logic middleware middleware resource manager resource manager resource manager Company A (service provider) Web service interface clients from other companies access to internal systems resource manager Web services middleware (internal) service interface integration logic conventional middleware (includes middleware services) other tiers Conventional middleware provides lots of services (load balancing, transaction support, etc). Current Web services middleware is quite poor in this respect. other tiers [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 7 L’Architecture Externe Company A (service requester) Company B (service provider) Web service Web service client Web services middleware (internal) 3. interact Web services middleware (internal) other tiers other tiers 2. find the abstraction and infrastructure provided by the registry are part of the external middleware 1. publish the service description service descriptions Company C (directory service provider) [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 8 Le Middleware Externe Company A (service requester) external middleware Web service client internal middleware other tiers Company B (service provider) Web service transaction mgmt transaction mgmt other protocol infrastructure other protocol infrastructure composition engine composition engine internal middleware other tiers service descriptions [ACKM04] 14 Dicembre 2006 Company C (directory service provider) Rabat (Marocco) 9 La moindre infrastructure pour WS service provider service requestor application object (client) application object (service provider) SOAP-based middleware SOAP-based middleware SOAP messages exchanged on top of, HTTP, SMTP, or other transport converts procedure calls to/from XML messages sent through HTTP or other protocols. [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 10 Des Interfaces au Stub/Skeleton <operation name="orderGoods"> <input message = "OrderMsg"/> </operation> WSDL of service provider WSDL compiler (client side) WSDL compiler (server side) service requestor service provider application object (client) application object (service provider) stub skeleton SOAP-based middleware SOAP-based middleware SOAP messages [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 11 Registry service requestor service provider application object (client) application object (service provider) stub skeleton SOAP-based middleware SOAP-based middleware SOAP messages SOAP messages (to look for services) SOAP messages (to publish service description) SOAP-based middleware service descriptions [ACKM04] 14 Dicembre 2006 UDDI registry Rabat (Marocco) 12 SOAP (1) SOAP envelope SOAP header header block SOAP envelope SOAP envelope SOAP body SOAP body PurchaseOrder document -product item -quantity Acknowledgement document -order id (a) Document-style interaction SOAP body body block SOAP envelope SOAP envelope SOAP body SOAP body method name orderGoods method return input parameter 1 product item return value order id input parameter 2 quantity (b) RPC-style interaction [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 13 SOAP (2) <ProductItem> <name>…</name> <type>…</type> <make>…</make> </ProductItem> <ProductItem name=“…” type=“…” make=“…” /> <ProductItem name=“…” <type>…</type> <make>…</make> </ProductItem> <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2002/06/soap-envelope" > Different encoding styles <env:Header> <t:transactionID xmlns:t="http://intermediary.example.com/procurement" env:role="http://www.w3.org/2002/06/soap-envelope/role/next" env:mustUnderstand="true" > 57539 </t:transactionID> </env:Header> envelope header blocks <env:Body> <m:orderGoods env:encodingStyle="http://www.w3.org/2002/06/soap-encoding" xmlns:m="http://example.com/procurement"> <m:productItem> <name>ACME Softener</name> </m:productItem> <m:quantity> 35 </m:quantity> </m:orderGoods> </env:Body> body </env:Envelope> [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 14 RPC avec SOAP HTTP Post SOAP envelope SOAP header transactional context SOAP body service requestor name of the procedure service provider input parameter 1 SOAP engine HTTP engine client implementation (other tiers) input parameter 2 HTTP Post SOAP envelope HTTP engine SOAP engine service implementation (other tiers) SOAP header transactional context SOAP body return parameter [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 15 Le plus simple SOAP Middleware service provider service requestor client implementation service implementation invokes the local procedure of the service implementation invokes the service as a local call server stub client stub the router parses the message, identifies the appropriate stub, and delivers the parsed message invoke SOAP engine to prepare SOAP message SOAP engine packages SOAP into HTTP and passes it to an HTTP client that sends it to the provider SOAP router passes the content of the HTTP message to the router HTTP engine HTTP server [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 16 Web Service Definition Language (WS-DL) Service interface (abstract definition) WS-DL (v2.0) fournit un framework pour définir Interfaces: opérations et modèles d'input/output Spécifiques d'accès: protocol bindings (e.g., SOAP) Endpoint: la location du service 0..n support 1..n Interface Operation extend 1..n specify (how to invoke) 1..2 Message Binding 1 consist of consist of 1..n implement provide Endpoint Part Service 1..n 14 Dicembre 2006 Rabat (Marocco) Service implementation (concrète definition) 17 Message Exchange Patterns (1) input Client input Service in-only (no faults) Client fault Service robust in-only (message triggers fault) fault Client output Service out-only (no faults) 14 Dicembre 2006 Client output Service robust out-only (message triggers fault) Rabat (Marocco) 18 Message Exchange Patterns (2) (1) input Client input Service Client (2) output (?) output (2’) fault fault in-out (fault replaces message) in-optional-out (message triggers fault) (2’) fault fault (2) input Client Service (?) input Service Client Service (1) output output out-in (fault replaces message) out-optional-in (message triggers fault) 14 Dicembre 2006 Rabat (Marocco) 19 Exemple (1) Définition des messages et des modèles formels <definitions … > <types> <element name="ListOfSong_Type"> <complexType><sequence> <element minOccurs="0" maxOccurs="unbound“ name="SongTitle" type="xs:string"/> </sequence></complexType> </element> <element name="SearchByTitleRequest"> <complexType><all> <element name="containedInTitle“ type="xs:string"/> </all></complexType> </element> <element name="SearchByTitleResponse"> <complexType><all> <element name="matchingSongs“ xsi:type="ListOfSong_Type"/> </all></complexType> </element> 14 Dicembre 2006 Rabat (Marocco) 20 Exemple (2) <element name="SearchByAuthorRequest"> <complexType><all> <element name="authorName“ type="xs:string"/> </all></complexType> </element> <element name="SearchByAuthorResponse"> <complexType><all> <element name="matchingSongs“ xsi:type="ListOfSong_Type"/> </all></complexType> </element> <element name="ListenRequest"> <complexType><all> <element name="selectedSong“ type="xs:string"/> </all></complexType> </element> 14 Dicembre 2006 Rabat (Marocco) 21 Exemple (3) <element name="ListenResponse"> <complexType><all> <element name="MP3fileURL" type="xs:string"/> </all></complexType> </element> <element name="ErrorMessage"> <complexType><all> <element name="cause" type="xs:string"/> </all></complexType> </element> </types> 14 Dicembre 2006 Rabat (Marocco) 22 Exemple (4) Définition de l'interface <interface name="MP3ServiceType"> <operation name="search_by_title" pattern="in-out"> <input message="SearchByTitleRequest"/> <output message="SearchByTitleResponse"/> <outfault message="ErrorMessage"/> </operation> <operation name="search_by_author" pattern="in-out"> <input message="SearchByAuthorRequest"/> <output message="SearchByAuthorResponse"/> <outfault message="ErrorMessage"/> </operation> <operation name="listen" pattern="in-out"> <input message="ListenRequest"/> <output message="ListenResponse"/> Définition d'une <outfault message="ErrorMessage"/> opération </operation> </interface> </definitions> 14 Dicembre 2006 Rabat (Marocco) 23 UDDI Data Structures businessEntity name contacts description identifiers categories tModel tModel tModel key key key name name name description description description overviewDoc overviewDoc overviewDoc identifiers identifiers identifiers categories categories categories businessService service key name description categories bindingTemplate binding key description address detailed info references to tModels [ACKM04] 14 Dicembre 2006 tModel tModel key key name name description description overviewDoc overviewDoc identifiers identifiers categories categories Specs stored at the provider’s site Stored in the UDDI registry Rabat (Marocco) 24 Registry e non Repository overviewDoc (refer to WSDL specs and to API specs) <tModel tModelKey=”uddi:uddi.org:v3_publication”> <name>uddi-org:publication_v3</name> <description>UDDI Publication API V3.0</description> <overviewDoc> <overviewURL useType=”wsdlInterface”> http://uddi.org/wsdl/uddi_api_v3_binding.wsdl# UDDI_Publication_SoapBinding </overviewURL> </overviewDoc> <overviewDoc> <overviewURL useType=”text”> http://uddi.org/pubs/uddi_v3.htm#PubV3 </overviewURL> </overviewDoc> classification information (specifies that this tModel is about XML, WSDL, and SOAP specs) [ACKM04] 14 Dicembre 2006 <categoryBag> <keyedReference keyName=”uddi-org:types:wsdl” keyValue="wsdlSpec" tModelKey="uddi:uddi.org:categorization:types”/> <keyedReference keyName=”uddi-org:types:soap” keyValue="soapSpec" tModelKey="uddi:uddi.org:categorization:types”/> <keyedReference keyName=”uddi-org:types:xml” keyValue="xmlSpec" tModelKey="uddi:uddi.org:categorization:types”/> <keyedReference keyName=”uddi-org:types:specification” keyValue="specification" tModelKey="uddi:uddi.org:categorization:types”/> </categoryBag> </tModel> Rabat (Marocco) 25 UDDI e WSDL service requestor service provider WSDL service descriptions SOAP/HTTP SOAP/HTTPS Inquiry API Publishers API tModel Web service interface businessEntity service descriptions [ACKM04] 14 Dicembre 2006 businessService bindingTemplate UDDI registry Rabat (Marocco) 26 service requestor SOAP/HTTP Inquiry API service provider UDDI API SOAP/HTTPS Publishers API Inquiry API Web service interface Web service interface service descriptions Publishers API Subscription, Replication, and Custody transfer APIs (SOAP/HTTPS) service descriptions UDDI registry B UDDI registry A <?xml version="1.0"?> <find_tModel generic="1.0" xmlns="urn:uddi-org:api"> <categoryBag> <keyedReference tModelKey="UUID:C25893AF-1977-3528-36B5-4192C2AB9E2C" keyName="uddi-org:types" keyValue="wsdlSpec"/> <keyedReference tModelKey="UUID:A15019C5-AE14-236C-331C-650857AE0221" keyName="book pricing" keyValue="36611349"/> </categoryBag> [ACKM04] 14 Dicembre 2006 Rabat (Marocco) 27 Tout Ensemble service provider service implementation WSDL generator server stub WSDL service descriptions SOAP router WSDL compiler HTTP engine UDDI publisher 1 2 3 businessEntity businessService bindingTemplate Inquiry API [ACKM04] 14 Dicembre 2006 tModel Publishers API UDDI registry Rabat (Marocco) 28 La "Pile" des Web Service Registry/Repository & Discovery Multiple Interacting Services Single Service Messaging WSDL-based 14 Dicembre 2006 ebXML-based Rabat (Marocco) Semantic-based 29 Includes 3 specifications: (i) Web Service Context (WS-CTX) (ii) Web Service Coordination Framework (WS-CF) (iii) Web Service Transaction Management (WS-TXM) La "Pile“ basée sur WSDL repository & discovery UDDI Formerly BPEL4WS (BPEL for short) WS-Transaction WS-Coordination WS Composite Application Framework (WS-CAF) WS-CDL (i) formerly also WSEL (Web Service Endpoint Language) by IBM (ii) also the research/accademic proposal Web Service Offering Language [WSOL] WS-BPEL choreography WSCI BPML WSFL, XLANG WSCL, CS-WS WS-Policy, WSLA transaction management Both the Web Service Conversation Language (WSCL, by HP) and Conversation Support for Web Services (CS-WS, by IBM) proposals are no more supported WS-DL orchestration conversation description / interaction protocol non-functional features, QoS description (interface definition) WS Reliable Messaging advanced messaging WS-Routing, WS-Addressing XML Protocol – XMLP (SOAP) XML & XML Schema, … 14 Dicembre 2006 HTTP, SMTP, … Rabat (Marocco) basic messaging content transport 30 Composition Il s'occupe de l'implémentation d'une application (à son tour offerte comme Web Service) dont la logique applicative se base sur l'invocation d'opérations offertes par d’autres services nouveau service est un service composé (composite service) Les services invoqués sont les services composants (component services) Le 14 Dicembre 2006 Rabat (Marocco) 31 Un Middleware pour la Composition Through the development environment, a composition schema is synthesized, either manually or (semi-)automatically. A service composition model and a language (maybe characterized by a graphical and a textual representation) are adopted Orchestration: the run-time environment executes the composite service business logic by invoking other services (through appropriate protocols) Web service composition middleware House hunting service Packaging service Flight reservation service Shipment service Phone line installation service Internet DSL line installation service development environment run-time environment (orchestration engine) composition schema schema definitions composition schema designer composite service execution data other Web Services middleware (e.g., SOAP invocation engine) [ACKM04] Composite service provider 14 Dicembre 2006 Rabat (Marocco) Component services offered by other providers Supplier WS Warehouse WS Accounting WS 32 Business Process Execution Language for Web Services (WS-BPEL) coordination de Web Service Processus de business comme Web Service Il permet la spécifique soit des processus abstraits soit des processus exécutables Influencé par Modèles traditionnels pour les flux Plan structuré WSFL ET XLANG Client of the composite service Il permet la spécifique des compositions schéma de Web Service composé Processus de business comme Activity A Activity B Activity C Les services composants sont décrits en WS-DL (v1.1) 14 Dicembre 2006 Rabat (Marocco) 33 WS-BPEL Specification Document XML qui décrit: Rôles qui échangent les messages Les interfaces (WSDL) soutenues par chaque rôle L'orchestration du processus Variables et transformations sur les données Exception handling Corrélations Orchestration - variables and data transfers, - exception handling, - correlation information (for instance routing) interfaces roles Variables: warehouse: URI inStock, shippingAvail: bool customer: String … customer invoke checkLocalStock invoke checkShipAvailable warehouse local service offered by the supplier receive orderGoods invoke confirmOrder invoke cancelOrder supplier 14 Dicembre 2006 Rabat (Marocco) 34 Modèle du processus (Activités) Primitive invoke: to invoke a Web Service (in-out) operation receive: to wait for a message from an external source reply: to reply to an external source message wait: to remain idle for a given time period assign: to copy data from one variable to another throw: to raise exception errors empty: to do nothing A link connects exactly one source activity S to exactly one target Structured activity T; T starts only after S ends. sequence: sequential order An activity can have multiple incoming (possibly with join conditions) and switch: conditional routing outgoing links. Links can be guarded while: loop iteration pick: choices based on events flow: concurrent execution (synchronized by links) scope: to group activities to be treated “transactionally” (managed by the same fault handler, within the same transactional context) 14 Dicembre 2006 Rabat (Marocco) 35 14 Dicembre 2006 Rabat (Marocco) 36 Security Standards (1) WS-SecureConversation WS-Federation WS-Authorization WS-Trust WS-Privacy WS-Policy WS-Policy Attachments WS-Policy Assertions & WS-Security Policy Assertions WS-Security Basic standars, directly defined over SOAP / WSDL 14 Dicembre 2006 Rabat (Marocco) 37 Security Standards (2) “Secure” Channel Provides the abstraction of “secure & confidential” communication channel XML Digital Signature: to sign parts of XML documents (and therefore parts of the messages exchanged between client and WS) XML Encryption: to cypher parts of XML Documents XML Key Management Services: the interface of basic Web Services for processing and management of keys based on PKI WS-Security: integrity and confidentiality end-to-end of messages 14 Dicembre 2006 Rabat (Marocco) 38 Security Standards (3) Description of Features The WS-Policy family allows the description of requirements and capabilities of a WS, in order to provide clients with needed information WS-PolicyAttachment: to link assertions to a WS WS-PolicyAssertions and WS-SecurityPolicyAssertions are the languages for expressing such assertions Trust WS-Trust defines a model for establishing trust between client and WS, based on third parties (Security Token Services – to be realized as infrastructural services) Definition of protocols and interfaces for verifying authenticity and freshness of the tokens presented by the subjects Secure Conversations WS-SecureConversation: mechanisms for establishing and exchanging security contexts, to be used during exchanges of messages belonging to the same conversation Others (not yet mature) WS-Privacy WS-Authorization WS-Federation 14 Dicembre 2006 Rabat (Marocco) 39 Security Standards (4) SAML (Security Assetion Markup Language) XML framework for exchanging authentication and authorization information for securing Web services XACML (eXtensible Access Control Markup Language) XML framework for specifying access control policies for Web-based resources 14 Dicembre 2006 Rabat (Marocco) 40 ebXML ebXML is more a standardized “conceptual framework”, a “reference model”, than a real stack of standard technologies Stable version in 2001/2002 Technical Architecture Specification (v1.04) Business Process Specification Schema (v1.01) Registry Information Model (v2.0) Registry Services Specification (v2.0) Requirements Specification (v1.06) Collaboration-Protocol Profile and Agreement Specification (v2.0) Message Service Specification (v2.0) Currently in revision Indeed, many Technical Committees (TCs) are working in synergy with the promoters of the W3C/WSDLbased “stack” E.g., UDDI v2 has been developed in the context of ebXML/OASIS, currently WS-BPEL and WS-CAF are being evolved/developed in the context of specific TCs, etc. 14 Dicembre 2006 Rabat (Marocco) 41 ebXML: Aims To define an open & public infrastructure, based on XML, for distributed electronic commerce Special attention to SMEs and developing countries Business Process, Core Components Registry/ Repository Process Definition Partner Discovery Process Evolution Process Management Electronic Business Collaboration Process Execution Partner Sign-up Collaboration Protocol Agreement Electronic Plug-in Message Service, Business Service Interface 14 Dicembre 2006 Collaboration Protocol Profile Rabat (Marocco) Business Service Interface 42 ebXML: Comment ? by using BPSS (Business Process Specification Schema) Business Process and Information Models (compliant to the Meta Model) Model to XML Conversion register Registries retrieve profiles & new/updated models retrieve profiles & new/updated models Registry Service Interface Collaboration Protocol Profile (CPP) register Business Service Interface Internal Business Application derive 14 Dicembre 2006 build retrieve models and profiles implementers govern exchange Collaboration Protocol Profile (CPP) build govern Collaboration Protocol Agreement (CPA) govern Rabat (Marocco) (message) payload derive register exchange Business Service Interface Internal Business Application in a sense, this is the “maximum intersection” choreography 43 ebXML: BPSS, CPP e CPA (1) BPSS is used for modeling a business process, thus obtaining a BPS (Business Process Specification) roles, collaborations and document exchanges (business transactions) Collaboration: set of activities; an activity is a business transaction or again a collaboration Business transaction: a partner is the requester, the other is the responder, in a business Partners, document flow CPP: expresses the capabilities of a partner in partecipating in a BPS 14 Dicembre 2006 Rabat (Marocco) 44 ebXML: BPSS, CPP e CPA (2) A wants to make electronic business with B; A is the acquirer and B the vendor; the process underlying the business is already defined in a BPS A discovers the B ’s CPP in a registry A CPA is created, as the intersection of A ’s CPP and B ’s CPP On the basis of the CPA, the A ’s and B ’s business service interfaces are configured in order to support the business transactions 14 Dicembre 2006 Rabat (Marocco) 45 ebXML: BPSS, CPP e CPA (3) (5) B’s server CPPB (1) Registry (3 - 4) (2) (6) CPPX CPPY CPPZ CPAA and B A’s server (5) 14 Dicembre 2006 (1) CPPA Each partner has registered its own CPP in the registry Partner A discovers B in the registry and download CPPB on its system Partner A creates CPAA and B and sends it to B After a negotiation (both manual or automatic), both A and B register identical copies of the agreed upon CPAA and B in their systems Both A and B configure their systems for runtime on the basis of CPAA and B Finally A and B engage their e-Commerce process Rabat (Marocco) 46