Académique Documents
Professionnel Documents
Culture Documents
étendus - SOAP
Module SOA
A.U 2023-2024
1
Objectif
SW SOAP
2
Plan
Introduction
SW SOAP
3
Introduction
WSDL
Annuaire
UDDI Publication
Découverte
WSDL
SOAP
XML
Consommateur Fournisseur
SW SOAP
4
Les standards d’un service Web étendu
SW SOAP
5
Fonctionnement d’un Service Web étendu
Messages
SOAP Appel
Application Serveur
Cliente HTTP d’application
Client Serveur
SW SOAP
6
Développement de Service Web SOAP
Deux façons pour développer un Service Web étendu:
Approche Bottom / Up
Implémenter l’application.
Compiler, déployer et tester.
Le document WSDL est automatiquement généré.
SW SOAP
7
Développement de Service Web SOAP
Approche Top/Down
WSDL file
Développement des
clients dans des langages
différents
WSDL
Java
Librairies nécessaires
Approche Bottom/Up
PHP
SOAP
.Net Implémentation
Serveur Python
d’application Java
C++
…
Couche Cliente
Couche Serveur
SW SOAP
8
Présentation de WSDL
SW SOAP
9
Structure d’un contrat WSDL
Un document WSDL se structure en 2 parties :
▪ Une description concrète Contrat WSDL
⮚Définition du protocole d'accès et de l’URI à
partir de laquelle on peut accéder au service
web
▪ Une description abstraite
⮚nom des opérations, paramètres d'entrée,
de sortie, structure des messages
SW SOAP
10
Structure d’un contrat WSDL
Avantages d'une structuration en 2 parties :
On peut associer la description abstraite avec plusieurs descriptions concrètes.
➔ Réutilisabilité de la description abstraite
Contrat WSDL
Partie abstraite
Protocole
HTTP SMTP
d’accès
Localisation URL1 URL2
SW SOAP
11
Les éléments WSDL
• Le document WSDL contient 7 éléments :
service
Description concrète
port
Elément de liaison entre la description binding
abstraite et concrète
port types
operations
Description abstraite
messages
types
SW SOAP
12
Exemple d’un contrat WSDL
SW SOAP
13
L’annuaire UDDI
SW SOAP 14
L’annuaire UDDI
SW SOAP 15
Structure des messages SOAP
(Simple Object Access Protocol)
SOAP message Message complet
HTTP headers Entête standard HTTP et entête SOAP HTTP
fault » (erreurs)
SW SOAP
16
SOAP message
SOAP header
<SOAP-ENV:Envelope xmlns:SOAP-
Header
ENV="http://schemas.xmlsoap.org/soap/envelope"> s
<SOAP-ENV:Body> SOAP body
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope">
<SOAP-ENV:Body>
<!-- Contenu de la réponse
reponse --> Message SOAP
</SOAP-ENV:Body> d’une réponse
</SOAP-ENV:Envelope>
SW SOAP
17
Les messages SOAP
Requête vers le service HelloWorld
Exemple: Appeler les opérations du service HelloWorld
SOAP message
<soap-env:Envelope HTTP headers
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope"
SOAP Envelope
xmlns:hel="http://helloworldservice... .com/">
<soapenv:Header/> SOAP header
<soapenv:Body> Headers
<soap-env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope"
xmlns:hel="http://helloworldservice... .com/">
<soapenv:Header/>
<soapenv:Body>
<hel:simpleHelloWorld> Message SOAP pour appeler
</hel:simpleHelloWorld> l’opération simpleHelloWorld
</soapenv:Body> ne contenant pas de
</soapenv:Envelope> paramètres
18
Les messages SOAP
Reponse vers le service HelloWorld
Exemple (suite) : Messages retour de l’appel des opérations du service HelloWorld
<soap-env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope">
<soapenv:Body>
<ns2:makeHelloWorldResponse xmlns:ns2="http://helloworldwebservice.... .com/">
<helloWorldResult>Hello World toto </helloWorldResult>
</ns2:makeHelloWorldResponse>
</soapenv:Body>
</soapenv:Envelope>
<soap-env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope">
<soapenv:Body>
<ns2:simpleHelloWorldResponse xmlns:ns2="http://helloworldwebservice.... .com/">
<helloWorldResult>Hello World Everybody </helloWorldResult>
</ns2:makeHelloWorldResponse>
</soapenv:Body>
</soapenv:Envelope> 19
Les messages SOAP
Exemple : corps de messages SOAP pour appeler des opérations du service Web Notebook
<soap-env:Envelope <soap-env:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope
xmlns: not="http://notebookwebservice.... .com/"> xmlns: not="http://notebookwebservice.... .com/">
<soapenv:Header/> <soapenv:Header/>
<soapenv:Body> <soapenv:Body>
<not:addPersonWithComplexType> <not:addPersonWithSimpleType>
<newperson> <name>toto</name>
<name>toto</name> <adress>France</adress>
<adress>France</adress> <birthyear>1980</birthyear>
<birthyear>1980</birthyear> </not:addPersonWithSimpleType>
</newperson> </soapenv:Body>
</not:addPersonWithComplexType>
</soapenv:Body>
</soapenv:Envelope> </soapenv:Envelope>
SW SOAP 20
Les messages SOAP
Exemple (suite) : corps de messages SOAP pour le résultat des opérations du service Web Notebook
<soap-env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope">
<soapenv:Body>
<ns2:addPersonWithComplexTypeResponse xmlns:ns2="http://notebookwebservice.... .com/">
<addPersonWithComplexTypeResult> true </addPersonWithComplexTypeResult>
</ns2: addPersonWithComplexTypeResponse >
</soapenv:Body>
</soapenv:Envelope>
<soap-env:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope">
<soapenv:Body>
<ns2:addPersonWithSimpleTypeResponse xmlns:ns2="http://notebookwebservice.... .com/">
<addPersonWithSimpleTypeResult> true </addPersonWithSimpleTypeResult>
</ns2: addPersonWithSimpleTypeResponse >
</soapenv:Body>
</soapenv:Envelope>
Les paramètres de sorties suivent la même convention que les paramètres d’entrées
21
SW SOAP
Principe de fonctionnement
Un service web étendu en action
SW SOAP
22
Références
▪ http://www.w3.org/TR/wsdl
▪ http://www.webservicex.net/ws/WSDetails.aspx?CATID=12&WSID=63
▪ http://www.slideshare.net/baronm/wsdl-dcrire-et-configurer-4677823
http://www.uddi.org/
http://www.w3schools.com/
SW SOAP
23