Librairie SOAP

Fermé
iznogoudatal Messages postés 1 Date d'inscription jeudi 22 novembre 2007 Statut Membre Dernière intervention 12 février 2014 - 12 févr. 2014 à 14:23
Bonjour,

J'ai un problème lorsque je tente d'accéder à un web service via la librairie SOAP de PHP5

Fichier WSDL visible à cette adresse : http://demo-wspublic-net.v12web.eu/service.asmx?wsdl

Voilà le code PHP que j'éxécute :



// première étape : désactiver le cache lors de la phase de test
ini_set("soap.wsdl_cache_enabled", "0");

$options = array(
"trace" => 1,
"exception" => 0
);

// Création du client.
$clientSOAP = new SoapClient('http://demo-wspublic-net.v12web.eu/service.asmx?wsdl', $options);

// executer la methode
$arguments = array(
"",
new SoapParam("c51ce410c124a10e0db5e4b97fc2af39", 'sIdFournisseur'),
new SoapParam("c81e728d9d4c2f636f067f89cc14862c", 'sIdService'),
new SoapParam(null, 'sIdClient'),
new SoapParam("C06VAFRXXX", 'sCodeDistributeur'),
new SoapParam(array(), 'ist_V_1')
);

// Appel
$reponse = $clientSOAP->__soapCall('setLead_V_1', $arguments);

echo "REQUEST: " . htmlentities($clientSOAP->__getLastRequest()) . "\n\n\n";

print_r($reponse->setLead_V_1Result);



Hors ce code me renvoi un XML de cette forme :


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://v12web.eu/">
<SOAP-ENV:Body>
<ns1:setLead_V_1/>
<sIdFournisseur>c51ce410c124a10e0db5e4b97fc2af39</sIdFournisseur>
<sIdService>c81e728d9d4c2f636f067f89cc14862c</sIdService>
<sIdClient/>
<sCodeDistributeur>C06VAFRXXX</sCodeDistributeur>
<ist_V_1/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Alors que la bonne forme du XML attendu par le WebService est de cette forme :


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://v12web.eu/">
<SOAP-ENV:Body>
<ns1:setLead_V_1>
<ns1:sIdFournisseur>c51ce410c124a10e0db5e4b97fc2af39</ns1:sIdFournisseur>
<ns1:sIdService>c81e728d9d4c2f636f067f89cc14862c</ns1:sIdService>
<ns1:sIdClient/>
<ns1:sCodeDistributeur>C06VAFRXXX</ns1:sCodeDistributeur>
<ns1:ist_V_1/>
</ns1:setLead_V_1>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Auriez vous une idée ?