batch/1.1/old/wsVatClient.php

37 lines
1.5 KiB
PHP
Raw Normal View History

#!/usr/bin/php
<?
error_reporting(E_ALL);
ini_set('soap.wsdl_cache_enabled', 0);
$client = new SoapClient('http://ws.scores-decisions.com/entreprise/vat.wsdl',
array( 'trace' => 1, 'soap_version' => SOAP_1_1,
'login' => 'TESTTVA', 'password' => 'TVATESTPW'));
$argv=$_SERVER['argv'];
try {
$O = $client->getCompanyVat($argv[1]);
if ($O->error->errnum) {
echo 'Erreur : '. $O->error->errmsg .' ('. $O->error->errnum .")\n";
echo $client->__getLastResponse()."\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";
echo 'Site Web : '. $val->siteWeb ."\n";*/
echo 'Siren .... '. $val->siren ."\n";
2013-06-19 08:24:49 +00:00
echo 'N<> TVA ... '. $val->vatNumber .' ('. $val->vatDefined .")\n";
// echo $client->__getLastRequest()."\n";
echo $client->__getLastResponse()."\n";
}
} catch (SoapFault $fault) {
echo $client->__getLastResponse()."\n";
echo 'ERREUR SOAP :'.EOL;
print_r($fault);
}
?>