Bonsoir à Tous,
Je galère depuis plusieurs jours à essayer de décrypter un flux XML envoyé par un client php SOAP et je n'arrive pas à récupérer les données coté Serveur SOAP.
Je dois pouvoir récupérer ces données et les enregistrer dans une base de données.
Ma partie client fonctionne car j'ai pu la tester sur un serveur SOAP qui intègre ce service et dont je n'ai pas la main.
Le problème est que je n'ai pas la main sur celui-ci.
Ma partie "client" est :
Le WSDL a comme format :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <?php require_once('./server/nusoap.php'); $wsdl='http://localhost/server/server.php?wsdl'; $client=new nusoap_client($wsdl,'wsdl'); $data= Array( 'magasin' => Array( 'nom' => 'DUPONT', 'code' => '3456L' ), 'commandes' => Array( '0' => Array( 'client' => Array( 'civilite' => '3', 'nom' => 'lucien', 'prenom' => 'michel', 'adresse1' => '25 ROUTE DU MOULIN', 'adresse2' => NULL, 'code_postal' => '37000', 'ville' => 'JOUE LES TOURS', 'pays' => 'France', 'email' => 'lucien.michel@wanadoo.fr', 'tel_fixe' => '0234567844', 'tel_mobile' => '0450842344' ), 'commande' => Array( 'numero' => '1234_1', 'date' => '2009-12-14', 'montant' => '305' ), 'produits' => Array( '0' => Array( 'type' =>'Lave-Linge SAMSUNG', 'marque' => 'SAMSUNG', 'modele' => 'SRS2028', 'date_achat' => '2009-12-18', 'prix_achat' => '305', 'garantie_ini' => '5', 'duree_ext' => '0', 'prix_ext' => '0', 'date_effet' => '2009-12-18' ) ) ) ) ); // Call the SOAP method $result=$client->call('ext_commandes',$data); ?>
Pourriez-vous m'éclairer sur la méthode de récupération de ce flux data coté serveur ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124<?xml version="1.0" encoding="ISO-8859-1"?> <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:XMLWSDL" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:XMLWSDL"> <types> <xsd:schema targetNamespace="urn:XMLWSDL"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> <xsd:complexType name="AsxMagasin"> <xsd:all> <xsd:element name="nom" type="xsd:string" mandatory="true" comment="Nom du magasin/ partenaire - Fourni par XML"/> <xsd:element name="code" type="xsd:string" mandatory="true" comment="Code du magasin/ partenaire - Fourni par XML"/> </xsd:all> </xsd:complexType> <xsd:complexType name="AsxClient"> <xsd:all> <xsd:element name="civilite" type="xsd:int" mandatory="true" comment="Civilité du client. Les valeurs suivantes doivent être utilisées : 1=Madame, 2=Mademoiselle, 3=Monsieur"/> <xsd:element name="nom" type="xsd:string" mandatory="true" comment="Nom du client"/> <xsd:element name="prenom" type="xsd:string" mandatory="true" comment="Prénom du client"/> <xsd:element name="adresse1" type="xsd:string" mandatory="true" comment="Adresse principale du client (Numéro et rue)"/> <xsd:element name="adresse2" type="xsd:string" mandatory="false" comment="Complément d'adresse"/> <xsd:element name="code_postal" type="xsd:string" mandatory="true" comment="Code postale"/> <xsd:element name="ville" type="xsd:string" mandatory="true" comment="Ville"/> <xsd:element name="pays" type="xsd:string" mandatory="false" comment="Pays. Si ce champs est vide, la valeur par défaut sera 'FRANCE'"/> <xsd:element name="email" type="xsd:string" mandatory="true" comment="Adresse email du client. Cette adresse servira entre autre à lui envoyer son contrat au format PDF"/> <xsd:element name="tel_fixe" type="xsd:string" mandatory="true" comment="Numéro de Téléphone fixe - 15 caractères max."/> <xsd:element name="tel_mobile" type="xsd:string" mandatory="true" comment="Numéro de téléphone portable - 15 caractères max."/> </xsd:all> </xsd:complexType> <xsd:complexType name="AsxProduitCommande"> <xsd:all> <xsd:element name="type" type="xsd:string" mandatory="true" comment="Nom de famille/ catégorie/ classification du produit, exemple : TV, Lave-linge, PC Portable"/> <xsd:element name="marque" type="xsd:string" mandatory="true" comment="Nom de la marque du produit"/> <xsd:element name="modele" type="xsd:string" mandatory="true" comment="Modèle du produit"/> <xsd:element name="date_achat" type="xsd:dateTime" mandatory="true" comment="Date d'achat du produit - format aaaa-mm-jj"/> <xsd:element name="prix_achat" type="xsd:int" mandatory="true" comment="Prix d'achat du produit arrondi à l'euro prés, ne pas indiquer les centimes"/> <xsd:element name="garantie_ini" type="xsd:int" mandatory="true" comment="Durée de la garantie constructeur en nombre d'années"/> <xsd:element name="duree_ext" type="xsd:int" mandatory="true" comment="Durée de l'extension de garantie souscrite en nombre d'année"/> <xsd:element name="prix_ext" type="xsd:decimal" mandatory="true" comment="Prix de l'extension de garantie souscrite en euros"/> <xsd:element name="date_effet" type="xsd:dateTime" mandatory="true" comment="Date à laquelle démarre la garantie souscrite (format aaaa-mm-jj)."/> </xsd:all> </xsd:complexType> <xsd:complexType name="AsxProduitsCommandes"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="AsxProduitCommande[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="AsxCommande"> <xsd:all> <xsd:element name="numero" type="xsd:string" mandatory="false" comment="Numéro de la commande. Si ce numéro n'est pas fourni, il sera généré automatiquement"/> <xsd:element name="date" type="xsd:dateTime" mandatory="true" comment="Date de la commande - format aaaa-mm-jj"/> <xsd:element name="montant" type="xsd:decimal" mandatory="true" comment="Montant TTC de la commande en euros"/> </xsd:all> </xsd:complexType> <xsd:complexType name="AsxExtCommandesInput"> <xsd:all> <xsd:element name="client" type="tns:AsxClient" mandatory="true" comment="Structure contenant les données du Client, voir AsxClient"/> <xsd:element name="commande" type="tns:AsxCommande" mandatory="true" comment="Structure contenant les données de la Commande, voir AsxCommande"/> <xsd:element name="produits" type="tns:AsxProduitsCommandes" mandatory="true" comment="Structure contenant la liste de produits (extension + infos produits) commandés, voir AsxProduitsCommandes et AsxProduitCommande"/> </xsd:all> </xsd:complexType> <xsd:complexType name="AsxExtCommandesInputs"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="AsxExtCommandesInput[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="AsxReponse"> <xsd:all> <xsd:element name="result" type="xsd:boolean" mandatory="true" comment="Etat du traitement de la commande. Vaut TRUE si la commande a été traité, FALSE si le traitement a échoué"/> <xsd:element name="errno" type="xsd:int" mandatory="false" comment="Code d'erreur. Retourné uniquement s'il y a erreur (result=FALSE)"/> <xsd:element name="errmsg" type="xsd:string" mandatory="true" comment="Message d'erreur. Retourné uniquement s'il y a erreur (result=FALSE)"/> </xsd:all> </xsd:complexType> </xsd:schema> </types> <message name="ext_commandesRequest"> <part name="magasin" type="tns:AsxMagasin" /> <part name="commandes" type="tns:AsxExtCommandesInputs" /></message> <message name="ext_commandesResponse"> <part name="return" type="xsd:boolean" /></message> <portType name="XMLWSDLPortType"> <operation name="ext_commandes"> <documentation>Enregistre une liste de commandes d'extensions de garantie. La liste doit contenir une commande min. Retourne true si le traitement se déroule correctement, false sinon. Une Soap Fault est renvoyé en cas d'erreur.</documentation> <input message="tns:ext_commandesRequest"/> <output message="tns:ext_commandesResponse"/> </operation> </portType> <binding name="XMLWSDLBinding" type="tns:XMLWSDLPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="ext_commandes"> <soap:operation soapAction="urn:XMLWSDL#ext_commandes" style="rpc"/> <input><soap:body use="encoded" namespace="urn:XMLWSDL" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> <output><soap:body use="encoded" namespace="urn:XMLWSDL" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> </operation> </binding> <service name="XMLWSDL"> <port name="XMLWSDLPort" binding="tns:XMLWSDLBinding"> <soap:address location="http://localhost/server/server.php"/> </port> </service> </definitions>
Merci d'avance pour votre aide.
Partager