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
|
<?php
// Pour supprimer le cache du web-service
ini_set('soap.wsdl_cache_enabled', 0);
// Nouveau Client SOAP
try {
// Nouvelle instance de la classe soapClient
$methode = new SoapClient('http://localhost:8020/PJSW/services/Connexion?wsdl', array('trace' => 1));
$identifiant= $_POST['id'];
$password= $_POST['mp'];
// Appel de la méthode QuelJour du service web
try{
$Resultat = $methode -> __call('identification', array($identifiant, $password));
} catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
// affiche le résultat
if ($Resultat == true)
{
echo "Utilisateur trouvé";
}
elseif ($Resultat == false)
{
echo "Utilisateur non trouvé";
}
} catch (SoapFault $fault) {
echo 'erreur : '.$fault;
}
?> |
Partager