Les Web Services. Stéphane Bortzmeyer <bortzmeyer@nic.fr> Novembre 2003



Documents pareils
Intégration d'applications à "gros grain" Unité d'intégration : le "service" (interface + contrat)

Introduction aux «Services Web»

Architectures Web Services RESTful

Cours Master Recherche RI 7 Extraction et Intégration d'information du Web «Services Web»

Programmation Web Avancée Introduction aux services Web

Manuel d intégration API SOAP SMS ALLMYSMS.COM

Utilisation de JAVA coté Application serveur couplé avec Oracle Forms Hafed Benteftifa Novembre 2008

Le cadre des Web Services Partie 1 : Introduction

Introduction...3. Objectif...3. Manipulations...3. Gestion des utilisateurs et des groupes...4. Introduction...4. Les fichiers de base...

COMPRENDRE L ARCHITECTURE DES WEB SERVICES REST. Amosse EDOUARD, Doctorant

Sécurité des Web Services (SOAP vs REST)

4. SERVICES WEB REST 46

L3 informatique TP n o 2 : Les applications réseau

Application Web et J2EE

SOAP Concepts Application à Glassfish

Plateforme PAYZEN. Définition de Web-services

Les Services Web. Jean-Pierre BORG EFORT

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,

Instructions Mozilla Thunderbird Page 1

Avant-propos. VERSION Compilation du document à l aide de PDFLATEX Philippe Charlier. 1 Version actuelle : SPIP http ://

Architecture Orientée Service, JSON et API REST

OpenPaaS Le réseau social d'entreprise

Paris Airports - Web API Airports Path finding

Gestion centralisée d un réseau de sites discrets. Nicolas JEAN

Technologies pour Web Services faciles : REST, JSON

INF8007 Langages de script

Systèmes d'informations historique et mutations

VTP. LAN Switching and Wireless Chapitre 4

Programmation Web. Madalina Croitoru IUT Montpellier

How to Login to Career Page

JADE : Java Agent DEvelopment framework. Laboratoire IBISC & Départ. GEII Université & IUT d Evry nadia.abchiche@ibisc.univ-evry.

Protocoles Applicatifs

Introduction...3. Objectif...3. Manipulations...3. La Sauvegarde...4. Les différents types...4. Planification...4. Les outils...5

Lier Erlang avec d autres langages de programmation

SUGARCRM Sugar Open Source Guide d Installation de French SugarCRM Open Source Version 4.2

Manuel d implémentation des Web Services Sous Axis1 et Axis2/Tomcat/linux. Par Pr Bouabid EL OUAHIDI

Guide pratique de CSPM, l'outil de suivi des performances du système Version française du Complete System Performance Monitor HOWTO

Module http MMS AllMySMS.com Manuel d intégration

L envoi d un formulaire par courriel. Configuration requise Mail Texte Mail HTML Check-list

Remote Method Invocation Les classes implémentant Serializable

MELTING POTES, LA SECTION INTERNATIONALE DU BELLASSO (Association étudiante de lʼensaparis-belleville) PRESENTE :

Systèmes répartis. Fabrice Rossi Université Paris-IX Dauphine. Systèmes répartis p.1/49

WEBSERVICES. Michael Fortier. Master Informatique 2ème année. A308, Université de Paris 13

Tests de montée en charge avec Tsung

Prototype de canal caché dans le DNS

Configurer la supervision pour une base MS SQL Server Viadéis Services

Frequently Asked Questions

ADMINISTRATION DE ADOBE LIVECYCLE MOSAIC 9.5

Remote Method Invocation (RMI)

XML, PMML, SOAP. Rapport. EPITA SCIA Promo janvier Julien Lemoine Alexandre Thibault Nicolas Wiest-Million

Introduction aux. services web 2 / 2

Calcul Parallèle. Cours 5 - JAVA RMI

Problématiques de recherche. Figure Research Agenda for service-oriented computing

Hébergement de sites Web

Cloud et SOA La présence du Cloud révolutionne-t-elle l approche SOA?

PUPPET. Romain Bélorgey IR3 Ingénieurs 2000

Méthodes et Langages du Commerce Electronique

Ocs Inventory et GLPI s appuie sur un serveur LAMP. Je vais donc commencer par installer les paquets nécessaires.

Internet Group Management Protocol (IGMP) Multicast Listener Discovery ( MLD ) RFC 2710 (MLD version 1) RFC 3810 (MLD version 2)

Projet de programmation (IK3) : TP n 1 Correction

Cette application développée en C# va récupérer un certain nombre d informations en ligne fournies par la ville de Paris :

Installation de DocBook sur un système Linux

(structure des entêtes)

Alfstore workflow framework Spécification technique

Practice Direction. Class Proceedings

Business Process Execution Language

Comment Accéder à des Bases de Données MySQL avec Windows lorqu'elles sont sur un Serveur Linux

Urbanisation des SI Conduite du changement IT 20/03/09. Patrick CHAMBET

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

PRIMAVERA P6 ENTERPRISE PROJECT PORTFOLIO MANAGEMENT WEB SERVICES

INTERNET est un RESEAU D ORDINATEURS RELIES ENTRE EUX A L ECHELLE PLANETAIRE. Internet : interconnexion de réseaux (anglais : net = réseau)

MapReduce. Malo Jaffré, Pablo Rauzy. 16 avril 2010 ENS. Malo Jaffré, Pablo Rauzy (ENS) MapReduce 16 avril / 15

Autour du web. Une introduction technique Première partie : HTML. Georges-André SILBER Centre de recherche en informatique MINES ParisTech

Adolphe Francois Julien Marmel Dominique Perlat Olivier Printemps SOAP. Simple Object Access Protocol. Encadrant : Chantal Taconet

Manuel d'exploitation de l'application Vitamin version 1.0

TP JEE Développement Web en Java. Dans ce TP nous commencerons la programmation JEE par le premier niveau d une application JEE : l application web.

Java RMI. Arnaud Labourel Courriel: Université de Provence. 8 mars 2011

Le Web de Données Dan VODISLAV Université de Cergy-Pontoise Master Informatique M2 Plan

API Web Service TéléAlerte

Il est recommandé de fermer les serveurs DNS récursifs ouverts

SIP. Plan. Introduction Architecture SIP Messages SIP Exemples d établissement de session Enregistrement

MailStore Server 7 Caractéristiques techniques

Installation d'un serveur RADIUS

Les Architectures Orientées Services (SOA)

Dis papa, c est quoi un bus logiciel réparti?

Form of Deeds Relating to Certain Successions of Cree and Naskapi Beneficiaries Regulations

HTTP. Technologies du Web. Programmation Web côté serveur. Mastère spécialisé Management et nouvelles technologies, 16 novembre 2009

Sécurité des applications web. Daniel Boteanu

25 septembre Migration des accès au Registre national en protocole X.25 vers le protocole TCP/IP, pour les utilisateurs du Registre national

Introduction à Java. Matthieu Herrb CNRS-LAAS. Mars

RMI. Remote Method Invocation: permet d'invoquer des méthodes d'objets distants.

Tutoriel: Création d'un Web service en C++ avec WebContentC++Framework

L Orchestration de Services Web avec Orchestra. Goulven Le Jeune Orchestra Project Manager

Web Application Firewalls (WAF)

If the corporation is or intends to become a registered charity as defined in the Income Tax Act, a copy of these documents must be sent to:

AMENDMENT TO BILL 32 AMENDEMENT AU PROJET DE LOI 32

Module BD et sites WEB

A DESTINATION DES SERVICES TIERS. Editeurs d applications et ressources pédagogiques connectées à l ENT

Transcription:

Les Web Services <bortzmeyer@nic.fr> Novembre 2003

Les Web Services (JRES 2003) 0 Ce document est distribué sous les termes de la GNU Free Documentation License http://www.gnu.org/licenses/licenses.html#fdl. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

Les Web Services (JRES 2003) 1 Pourquoi utiliser le réseau C est l autre machine qui a les données C est l autre machine qui va vite C est l autre machine qui a les bons logiciels

Les Web Services (JRES 2003) 2 Avant les Web Services, les bricolages On copiait les données et les logiciels (cohérence), On analysait les pages Web (Welcome to Hell), On formatait en texte puis on re-analysait (whois...).

Les Web Services (JRES 2003) 3 Programmation réseau sérieuse On faisait tout à la main (définir un protocole, peut-être avec BEEP, écrire les clients et les serveurs) On avait des solutions spécifiques à un langage (RMI) Corba http://www.corba.org/ ONC-RPC

Les Web Services (JRES 2003) 4 Les Web Services arrivent http://www.w3.org/2002/ws/ Ils s appuient sur le succès du Web : Disponibilité de HTTP, Web, donc bon, Et on passe les coupe-feux! Voir quand même RFC 3205.

Les Web Services (JRES 2003) 5 Les Web Services spécifient : Un encodage (toujours XML), Un transport (souvent HTTP), Une organisation des requêtes et réponses (RPC, par exemple).

Les Web Services (JRES 2003) 6 http://www.xml-rpc.com XML-RPC, le plus simple Principe : la bibliothèque client encode les paramètres en XML et la bibliothèque serveur les décode. Le programmeur ne voit jamais de XML. On ne fait que des appels de procédure. Transport en HTTP seulement. Bibliothèques pour tous : Perl, C, Python, Ruby, Java, VisualBasic/.NET, PHP et même Emacs-Lisp.

Les Web Services (JRES 2003) 7 XML-RPC, exemple Java // server has been created above Vector params = new Vector(); params.addelement(new Integer(5)); params.addelement(new Integer(3)); // Call the server, and get our result. Hashtable result = (Hashtable) server.execute("sample.sumanddifference", params); // We cannot use the procedure name directly (a limit of Java) int sum = ((Integer) result.get("sum")).intvalue(); int difference = ((Integer) result.get("difference")).intvalue();

Les Web Services (JRES 2003) 8 XML-RPC, exemple Python server = xmlrpclib.server ( http://whois.eureg.org:8080/rpc2 ) # Call the server, and get our result. result = server.sample.sumanddifference(3, 5); sum = result["sum"] difference = result["difference"]

Les Web Services (JRES 2003) 9 Exemples : Meerkat Un service d informations en ligne http://www.oreillynet.com/ pub/a/rss/2000/11/14/meerkat_xmlrpc.html, accessible en XML-RPC. <?php $server_url = /meerkat/xml-rpc/server.php ; $msg = new xmlrpcmsg( meerkat.getcategories, array()); $client = new xmlrpc_client($server_url, "www.oreillynet.com", 80); # Send our XML-RPC message to the server and receive a response in return $response = $client->send($msg); $value = $response->value(); # And convert it to a PHP data structure $categories = xmlrpc_decode($value); # Iterate over the results, printing each category s title

Les Web Services (JRES 2003) 10 while( list($k, $v) = each( $categories ) ) { print $v[ title ]. "<br />\n"; }?>

Les Web Services (JRES 2003) 11 Exemples : Adam s Names Une interface d accès au registre : http://www.adamsnames.tc/api/xmlrpc.html Permet par exemple un whois moderne : my $rpc = Frontier::Client->new( url => http://www.adamsnames.tc/api/xmlrpc ); my $status = $rpc->call( domquery, xmlrpcdemo.tc ); my $dumper = Data::Dumper->new([ $status ])->Terse(1)->Indent(1); my $txt = $dumper->dump;

Les Web Services (JRES 2003) 12 Types de paramètres : XML-RPC, détails entiers, dates, booléens, chaines structs (tableaux associatifs) tableaux Les erreurs sont signalées par des exceptions.

Les Web Services (JRES 2003) 13 XML-RPC, le serveur Avec le registry de XML-RPC (pour l introspection).... self.registry.add_method( registry.querydomain, self.domquery, [[STRUCT, STRING, STRUCT]])... def domquery (self, domain, credentials): """Queries the registry for a domain s attributes""" if credentials.has_key( name ): raise Unauthorized self.cursor.execute(""" SELECT name, def call (self, methodname, params): """Use our registry to find and call the appropriate method.""" try: return self.registry.dispatch_call(methodname, params) except Unauthorized:

Les Web Services (JRES 2003) 14 raise xmlrpclib.fault(403, Unauthorized )

Les Web Services (JRES 2003) 15 XML-RPC, sur le câble Uniquement si vous voulez écrire une bibliothèque POST /RPC2 HTTP/1.0 User-Agent: Frontier/5.1.2 (NetBSD) Host: betty.userland.com Content-Type: text/xml Content-length: 181 <?xml version="1.0"?> <methodcall> <methodname>examples.getstatename</methodname> <params> <param> <value><i4>41</i4></value> </param> </params> </methodcall>

Les Web Services (JRES 2003) 16 Un O Reilly très bien XML-RPC, lectures Le HOWTO http: //xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html

Les Web Services (JRES 2003) 17 XML-RPC, limites Unicode? (uniquement ASCII, en standard) Introspection? http://xmlrpc-c.sourceforge.net/ xmlrpc-howto/xmlrpc-howto-api-introspection.html

Les Web Services (JRES 2003) 18 SOAP, le plus vendu http://www.soapware.org/ http://www.w3.org/tr/soap/ Simple Object Access Protocol Le meilleur marketing (W3C et Microsoft)

Les Web Services (JRES 2003) 19 Très proche de XML-RPC. SOAP, les principes La bibliothèque client encode les paramètres en XML et la bibliothèque serveur les décode. Le programmeur ne voit jamais de XML. On fait des appels de procédure ou de l asynchrone. Transport en HTTP, BEEP, etc. Bibliothèques pour tous : Perl, C, C#, Python, Ruby, Java, VisualBasic/.NET, PHP, Ada.

Les Web Services (JRES 2003) 20 SOAP, un exemple Perl SOAP::Lite http://www.soaplite.com/ # Utilise l AUTOLOAD de Perl use SOAP::Lite +autodispatch => uri => http://www.soaplite.com/temperatures, proxy => http://services.soaplite.com/temper.cgi ; print f2c(100), "\n"; # Appelle une procédure distante

Les Web Services (JRES 2003) 21 SOAP, un exemple Python SOAPpy http://pywebsvcs.sourceforge.net/ server = SOAP.SOAPProxy( http://api.google.com/search/beta2, namespace= urn:googlesearch ) result = server.dogooglesearch( Zls0Q7uAt2Lrcd7BHjai...zWJj7, python wsdl,...); print result[ estimatedtotalresultscount ]

Les Web Services (JRES 2003) 22 Types de paramètres : SOAP, détails entiers, dates, booléens, chaines, etc (tout ce qu on peut écrire avec les schémas) structs (tableaux associatifs) tableaux Les erreurs sont signalées par des exceptions (faults).

Les Web Services (JRES 2003) 23 SOAP, le serveur use SOAP::Transport::HTTP; my $daemon = SOAP::Transport::HTTP::Daemon -> new (LocalAddr => localhost, LocalPort => 8080) -> dispatch_to( Handler ); $daemon->handle; package Handler; sub hi { return "hello, world"; } sub bye { return "goodbye, cruel world"; }

Les Web Services (JRES 2003) 24 Serveur SOAP plus détaillé On veut créer un service indiquant la disponibilité d un nom de domaine. % whois -h whois.sidn.nl is bortzmeyer.nl bortzmeyer.nl is free % whois -h whois.sidn.nl is ripe.nl ripe.nl is active

Les Web Services (JRES 2003) 25 Méticiel On développe une bibliothèque métier, assez indépendante de SOAP. package Meticiel; sub is_available () { if ($domain!~ /\.fr$/) { return "We only register domains in \".fr\""; } if (&registered($domain)) { return "Domain $domain already registered"; } return "Domain $domain is available. Buy it soon!"; }

Les Web Services (JRES 2003) 26 Logiciel réseau Puis on écrit la colle SOAP autour. use SOAP::Transport::HTTP; $hostname = hostname ; chomp $hostname; my $daemon = SOAP::Transport::HTTP::Daemon -> new (LocalAddr => $hostname, LocalPort => 8080) -> dispatch_to(undef, Meticiel, undef, undef); print "Contact to SOAP server at ", $daemon->url, "\n"; $daemon->handle; On peut alors développer les clients. $result = SOAP::Lite -> uri( http://does-not-exist-really-just-a-uri.nic.fr/meticiel ) -> proxy("http://$hostname:8080/") -> is_available($domain); unless ($result->fault) {

Les Web Services (JRES 2003) 27 print $result->result(); print "\n"; } else { print join,, $result->faultcode, $result->faultstring, $result->faultdetail; }

Les Web Services (JRES 2003) 28 SOAP, sur le câble Uniquement si vous voulez écrire une bibliothèque SOAP s appuie sur les schémas XML. SOAP permet de transmettre du XML brut (à analyser soi-même). POST /StockQuote HTTP/1.1 Content-Type: text/xml; charset="utf-8" Content-Length: 2456 SOAPAction: "http://electrocommerce.org/abc#mymessage"

Les Web Services (JRES 2003) 29 SOAP, sur le câble, suite <SOAP-ENV:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <myapp:getlasttradeprice xmlns:myapp="some-uri"> <symbol></symbol> </myapp:getlasttradeprice> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Les Web Services (JRES 2003) 30 Un O Reilly assez médiocre SOAP, lectures Plein de SOAP pour les nuls.

Les Web Services (JRES 2003) 31 Usine à gaz SOAP, les problèmes Peu interopérable What s wrong with SOAP? wc soap-spec.txt 1519 10671 79445 soap-spec.txt wc xmlrpc-spec.txt 315 1657 15838 xmlrpc-spec.txt

Les Web Services (JRES 2003) 32 Exemples : Google Google a un accès SOAP http://www.google.com/apis/index.html, décrit en WSDL (inscription gratuite et obligatoire)

Les Web Services (JRES 2003) 33 http://www.amazon.com/webservices Exemple, Amazon IL existe des paquetages tout faits, au dessus de SOAP. % perl amazon-by-keyword.pl ipv6 IPv6 Essentials - $27.97 Understanding Ipv6 - $20.99 IP Addressing and Subnetting, Including IPv6 - $41.97...

Les Web Services (JRES 2003) 34 UDDI, l annuaire universel http://www.uddi.org/ Oasis et d autres. Permet d enregistrer les Web Services, afin de les retrouver. ( The CPAN of Web Services ) Un protocole + plusieurs registres (encore du travail pour les gérants de registre). Un registre UDDI peut être accédé en SOAP mais aussi en XML-RPC ou Corba. Documentation difficile à aborder (Oasis...). L information estr très structurée, avec beaucoup de niveaux.

Les Web Services (JRES 2003) 35 UDDI, exemple use UDDI::Lite +autodispatch => proxy => http://uddi.microsoft.com/inquire ; $info = find_business(name => amazon ) -> businessinfos->businessinfo->serviceinfos->serviceinfo; print $info->name, "\n";

Les Web Services (JRES 2003) 36 UDDI, plein pot # find_* : "fuzzy" searches # get_* : exact searches, with the key $mybusinesslist = find_business(name => ama ); $mybusinessinfos = $mybusinesslist->businessinfos; @mybusinessinfo = $mybusinessinfos->businessinfo; for $mybusinessinfo (@mybusinessinfo) { print $mybusinessinfo->name, "\n"; print $mybusinessinfo->businesskey, "\n\n"; $myserviceinfos = $mybusinessinfo->serviceinfos; @myserviceinfo = $myserviceinfos->serviceinfo; for $myserviceinfo (@myserviceinfo) { print " ", $myserviceinfo->name, "\n"; print " ", $myserviceinfo->servicekey, "\n"; @myservicedetails = get_servicedetail (servicekey => $myserviceinfo->servicekey);

Les Web Services (JRES 2003) 37 for $myservicedetail (@myservicedetails) { print " ", $myservicedetail->name, "\n"; print " ", $myservicedetail->description, "\n"; $mybindingtemplate = $myservicedetail->bindingtemplates->bindingtemplate; # Actually, several print " ", $mybindingtemplate->description, "\n"; print " ", $mybindingtemplate->accesspoint, "\n"; } print "\n"; } } print "\n\n";

Les Web Services (JRES 2003) 38 WSDL, méta-informations WSDL est un langage (du W3C http://www.w3c.org/tr/wsdl) pour décrire les API (surtout pour SOAP)

Les Web Services (JRES 2003) 39 WSDL, exemple my $google = SOAP::Lite->service( http://api.google.com/googlesearch.wsdl ); my $result = $google->dogooglesearch( $key, $query, 0, 10, false,, false,, latin1, latin1 );

Les Web Services (JRES 2003) 40 1. Suivre un tutoriel, Utilisateurs : quelques conseils 2. Lire la spécification (formelle avec WSDL ou informelle), 3. Écrire le client (choix du langage, de la bibliothèque).

Les Web Services (JRES 2003) 41 Créateurs : quelques conseils 1. Choix importants (paiement, qualité de service, conditions d accès, conditions d usage, sécurité), 2. Écrire la spécification (formelle avec WSDL ou informelle), 3. Écrire la partie métier (si pas encore fait), 4. Écrire le serveur.

Les Web Services (JRES 2003) 42 L avenir est aux Web Services? Vers une migration technique vers les Web Services? Vers une vraie ouverture des systèmes d information? La fin des semantic firewall?