2012-10-16 07:44:31 +00:00
|
|
|
|
#!/usr/bin/php
|
|
|
|
|
<?
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
ini_set('soap.wsdl_cache_enabled', 0);
|
|
|
|
|
|
|
|
|
|
$client = new SoapClient('http://extranet.scores-decisions.com/ws/asso/asso.wsdl',
|
|
|
|
|
array( 'trace' => 1, 'soap_version' => SOAP_1_1,
|
|
|
|
|
'login' => 'TESTASSOSYSPERTEC', 'password' => 'TESTPW'));
|
|
|
|
|
$argv=$_SERVER['argv'];
|
|
|
|
|
switch ($argv[1]) {
|
|
|
|
|
case 'recherche':
|
|
|
|
|
try {
|
|
|
|
|
$O = $client->rechercheAsso($argv[2], @$argv[3], @$argv[4], @$argv[5]);
|
|
|
|
|
if ($O->error->errnum)
|
|
|
|
|
echo 'Erreur : '. $O->error->errmsg .' ('. $O->error->errnum .")\n";
|
|
|
|
|
else
|
|
|
|
|
foreach ( $O->results as $num=>$val ) {
|
|
|
|
|
echo $num .'. '. (string)$val->nomAssociation ."\n";
|
|
|
|
|
echo 'Identifiant S&D : '. $val->idAssociation ."\n";
|
|
|
|
|
if ($val->siret<>0) echo 'Siret : '. $val->siret."\n";
|
|
|
|
|
echo 'Adresse1 : '. $val->adresseNum .' '. $val->adresseIndRep .' '.
|
|
|
|
|
$val->adresseTypVoie .' '. $val->adresseLibVoie ."\n";
|
|
|
|
|
echo 'Adresse2 : '. $val->adresseComp ."\n";
|
|
|
|
|
echo 'Adresse3 : '. $val->adresseCodePostal .' '. $val->adresseVille ."\n";
|
2013-06-19 08:24:49 +00:00
|
|
|
|
echo 'Pr<50>fecture du d<>partement n<>'. $val->departement ."\n\n";
|
2012-10-16 07:44:31 +00:00
|
|
|
|
}
|
|
|
|
|
echo $client->__getLastRequest()."\n";
|
|
|
|
|
echo $client->__getLastResponse()."\n";
|
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
|
echo 'ERREUR SOAP :'.EOL;
|
|
|
|
|
print_r($fault);
|
|
|
|
|
echo $client->__getLastRequest()."\n";
|
|
|
|
|
echo $client->__getLastResponse()."\n";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'identite':
|
|
|
|
|
try {
|
|
|
|
|
$O = $client->identiteAsso($argv[2]);
|
|
|
|
|
if ($O->error->errnum)
|
|
|
|
|
echo 'Erreur : '. $O->error->errmsg .' ('. $O->error->errnum .")\n";
|
|
|
|
|
else {
|
|
|
|
|
$val=$O->result;
|
|
|
|
|
echo 'Nom : '. (string)$val->nomAssociation ."\n";
|
|
|
|
|
echo 'Identifiant S&D : '. $val->idAssociation ."\n";
|
|
|
|
|
if ($val->siret<>0) echo 'Siret : '. $val->siret."\n";
|
|
|
|
|
echo 'Adresse1 : '. $val->adresseNum .' '. $val->adresseIndRep .' '.
|
|
|
|
|
$val->adresseTypVoie .' '. $val->adresseLibVoie ."\n";
|
|
|
|
|
echo 'Adresse2 : '. $val->adresseComp ."\n";
|
|
|
|
|
echo 'Adresse3 : '. $val->adresseCodePostal .' '. $val->adresseVille ."\n";
|
2013-06-19 08:24:49 +00:00
|
|
|
|
echo 'Pr<50>fecture : '. $val->prefecture .' ('. $val->departement .")\n";
|
|
|
|
|
echo 'Activit<69> : '. $val->activite ."\n";
|
2012-10-16 07:44:31 +00:00
|
|
|
|
echo 'Site Web : '. $val->siteWeb ."\n";
|
|
|
|
|
echo 'E-mail : '. $val->email ."\n";
|
|
|
|
|
echo 'Objet : '. $val->objet ."\n";
|
|
|
|
|
echo $client->__getLastRequest()."\n";
|
|
|
|
|
echo $client->__getLastResponse()."\n";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
|
echo 'ERREUR SOAP :'.EOL;
|
|
|
|
|
print_r($fault);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
?>
|