Bonjour, voici un code PHP qui fonctionne (modifié volontairement) et je voudrais le mettre en WLangage.

Code php : 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
<?php 
header("Content-type: text/xml"); 
try 
{ 
  $clientSOAP = new SoapClient( null, 
    array ( 
      'uri' => 'http://www.xxxxxxxx.fr/api.php', 
      'location' => 'http://www.xxxxxxxx.fr/api.php', 
      'login' => 'user', 
      'password' => 'pass', 
      'trace' => 1, 
      'exceptions' => 0 
  )); 
 
  $ret = $clientSOAP->__call('get_ads', array( 
        'min_price'=>30000, 
        'max_price'=>70000, 
        'min_km'=>60001, 
        'max_km'=>100000, 
        'min_year'=>2012, 
        'max_year'=>2012, 
        'nb_results'=>10, 
        'txt'=>'dpf', 
        'page'=>'' 
        )); 
 
//echo "Request :\n".htmlspecialchars($clientSOAP ->__getLastRequest()) ."\n"; 
//echo "Response:\n".htmlspecialchars($clientSOAP ->__getLastResponse())."\n"; 
echo $ret; 
} 
catch(SoapFault $f) 
{ 
  echo $f; 
} 
 
?>

Le WSDL n'existe pas à proprement parler donc je ne peux pas l'intégrer à mon projet tout bêtement.

J'ai essayé :

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
SOAPAjouteEntête("uri","http://www.xxxxxxxx.fr/api.php","")
SOAPAjouteEntête("location","http://www.xxxxxxxx.fr/api.php","")
SOAPAjouteEntête("login","login","") 
SOAPAjouteEntête("password","password","") 
SOAPAjouteEntête("trace","1","") 
SOAPAjouteEntête("exceptions","0","")
 
 
SOAP.Valeur[1] = "30000"
SOAP.Nom[1] = "min_price"
SOAP.Type[1] = SOAPTypeChaîne
 
SOAP.Valeur[2] = "70000"
SOAP.Nom[2] = "max_price"
SOAP.Type[2] = SOAPTypeChaîne
 
...
 
 
SI SOAPExécute("http://www.xxxxxxxx.fr/api.php","get_ads")=Faux ALORS Info("c'est pété")
Info(SOAPDonneRésultat(SOAPRésultatXML))
Ne fonctionne pas.

Avez-vous une idée sur comment me dépêtrer de ce problème ?

Amicalement,

Eric.