Modification sur les types, et SoapFault
This commit is contained in:
parent
ff6a7d0670
commit
89514cf074
@ -31,7 +31,6 @@ Type[] = "InfosReg"
|
||||
Type[] = "InfosBourseReturn"
|
||||
Type[] = "InfosBourse"
|
||||
Type[] = "ListeBilansReturn"
|
||||
Type[] = "ListeBilansResult"
|
||||
Type[] = "ListeBilans"
|
||||
Type[] = "SetSurveillanceReturn"
|
||||
Type[] = "SurveillancesReturn"
|
||||
|
@ -350,13 +350,10 @@ class Entreprise extends WsScore
|
||||
$departement = $dep;
|
||||
|
||||
debugLog('I',"Liste des établissements demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (strlen($siren)<>9)
|
||||
{
|
||||
if (strlen($siren)<>9) {
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
elseif ($siren*1==0)
|
||||
{
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
@ -394,7 +391,7 @@ class Entreprise extends WsScore
|
||||
$this->wsLog('etablissements',$siren);
|
||||
$output = new ListeEtablissementsReturn();
|
||||
$output->nbReponses = $nbReponses;
|
||||
$output->liste = $result;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -414,19 +411,16 @@ class Entreprise extends WsScore
|
||||
|
||||
debugLog('I',"Dirigeants demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$tabRet = array();
|
||||
if (strlen($siren)<>9)
|
||||
{
|
||||
if (strlen($siren)<>9) {
|
||||
debugLog('W', "Siren/Siret $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
elseif ($siren*1==0)
|
||||
{
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
if ($histo) $option='histo';
|
||||
else $option='';
|
||||
if ($histo) $option = 'histo';
|
||||
else $option = '';
|
||||
$iInsee = new MInsee();
|
||||
$dirs = $iInsee->getDirigeants($siren, $histo);
|
||||
//debugLog('W', print_r($entrep, true), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
@ -450,9 +444,7 @@ class Entreprise extends WsScore
|
||||
}
|
||||
$this->wsLog('dirigeants',$siren,$option);
|
||||
debugLog('I', 'Nb Dirigeants retournés = '. count($dirs), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$output = new DirigeantsReturn();
|
||||
$output->nbReponses = count($liste);
|
||||
$output->result = $liste;
|
||||
return $output;
|
||||
}
|
||||
@ -748,7 +740,6 @@ class Entreprise extends WsScore
|
||||
if (empty($niveau)) { $niveau = 2; }
|
||||
if (empty($plus)) { $plus = false; }
|
||||
if ( !in_array($niveau, array(0,1,2,3,4,5)) ) { $niveau = 2; }
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
debugLog('I',"IndiScore demandée pour $siren en niveau $niveau",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (strlen($siren)>9 || (substr($siren,0,9)*1)<100 ){
|
||||
@ -905,7 +896,6 @@ class Entreprise extends WsScore
|
||||
}
|
||||
$this->wsLog('indiscore',$siren);
|
||||
$output = new IndiscoreReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
@ -914,40 +904,35 @@ class Entreprise extends WsScore
|
||||
* Liste de tous les évènements enregistrés à l'INSEE pour une entreprise
|
||||
* @param string $siren Siren de l'entreprise
|
||||
* @param string $nic
|
||||
* @param integer $deb
|
||||
* @param integer $max
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
* @return InseeReturn
|
||||
**/
|
||||
public function getListeEvenements($siren, $nic=0, $deb=0, $max=1000)
|
||||
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=1000)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('eveninsee');
|
||||
|
||||
//Initialisation
|
||||
if (empty($nic)) { $nic = 0; }
|
||||
if (empty($deb)) { $deb = 0; }
|
||||
if (empty($max) || $max>1000) { $max = 1000; }
|
||||
if (empty($position)) { $position = 0; }
|
||||
if (empty($nbRep) || $nbRep>1000) { $nbRep = 1000; }
|
||||
|
||||
debugLog('I',"Liste des évènements pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$tabRet = array();
|
||||
if (strlen($siren)<>9)
|
||||
{
|
||||
if (strlen($siren)<>9) {
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
elseif ($siren*1==0)
|
||||
{
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$iInsee = new MInsee();
|
||||
$evens = $iInsee->getEvenements($siren, $nic, $deb, $max);
|
||||
$evens = $iInsee->getEvenements($siren, $nic, $position, $nbRep);
|
||||
$tabRet = array();
|
||||
if (count($evens)>0)
|
||||
{
|
||||
foreach ($evens as $nb=>$even)
|
||||
{
|
||||
if (count($evens)>0) {
|
||||
foreach ($evens as $nb=>$even) {
|
||||
$iEven = new InseeEven();
|
||||
$iEven->Nic = $even['nic'];
|
||||
$iEven->Siege = $even['siege'];
|
||||
@ -961,10 +946,11 @@ class Entreprise extends WsScore
|
||||
$tabRet[] = $iEven;
|
||||
}
|
||||
}
|
||||
|
||||
debugLog('I', 'Nb évènements retournés = '. count($tabRet), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->wsLog('evenements',$siren);
|
||||
$output = new InseeReturn();
|
||||
$output->nbReponses = count($tabRet);
|
||||
$output->nbReponses = count($tabRet); // @todo : retrouver le nombre total d'évenements
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
@ -1125,13 +1111,10 @@ class Entreprise extends WsScore
|
||||
$siren = trim($siren);
|
||||
debugLog('I',"TVA demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$tabRet = array();
|
||||
if (strlen($siren)<>9)
|
||||
{
|
||||
if (strlen($siren)<>9) {
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
elseif ($siren*1==0)
|
||||
{
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
}
|
||||
@ -1209,7 +1192,7 @@ class Entreprise extends WsScore
|
||||
}
|
||||
$this->wsLog('tribunaux', '', print_r($tabTypes,1));
|
||||
$output = new TribunauxReturn();
|
||||
$output->tribunaux = $tabRet;
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -1374,7 +1357,7 @@ class Entreprise extends WsScore
|
||||
|
||||
$tabRet = array();
|
||||
if (count($tabRet)>0) {
|
||||
foreach ($ret as item ) {
|
||||
foreach ($ret as $item ) {
|
||||
$privileges = new PrivilegesDetail();
|
||||
$privileges->numDebiteur = $item['numDebiteur'];
|
||||
$privileges->greffe = $item['greffe'];
|
||||
@ -1407,7 +1390,7 @@ class Entreprise extends WsScore
|
||||
$tabRet[] = $privileges;
|
||||
}
|
||||
}
|
||||
$this->wsLog('privdetail', $siren, print_r($tabTypes,1));
|
||||
$this->wsLog('privdetail', $siren, join(',',$tabTypes));
|
||||
$output = new PrivilegesDetailReturn();
|
||||
$output->result = $tabRet;
|
||||
return $output;
|
||||
@ -1573,7 +1556,7 @@ class Entreprise extends WsScore
|
||||
* getSurveillances
|
||||
* @param SurveillancesFiltre $filtre
|
||||
* @param integer $deb
|
||||
* @param integer $nbRet
|
||||
* @param integer $nbRep
|
||||
* @return SurveillancesReturn
|
||||
*/
|
||||
public function getSurveillances($filtre, $position=0, $nbRep=100)
|
||||
@ -1940,7 +1923,6 @@ class Entreprise extends WsScore
|
||||
require_once 'Metier/tmp/configMRatios.php';
|
||||
$this->authenticate();
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
if (empty($page)) $page = 'ratios';
|
||||
$tabRatiosInfos = $tabRatiosSecteurs = $tabBilansR = array();
|
||||
$tabRatios2 = $tabRatiosEvol = array();
|
||||
@ -1948,13 +1930,12 @@ class Entreprise extends WsScore
|
||||
debugLog('I',"Liste des Ratios demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (strlen($siren)<>9){
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum =102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
$this->sendError('1010');
|
||||
} elseif ($siren*1==0) {
|
||||
debugLog('W', "Siren $siren inexistant", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum =102;
|
||||
$error->errmsg = 'Siren inexistant';
|
||||
} else {
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
debugLog('I',"Liste des Ratios demandée pour $siren avant getIdentiteEntreprise",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$iInsee = new MInsee();
|
||||
$tabIdentite = $iInsee->getIdentiteEntreprise($siren,0,0,false,false);
|
||||
@ -2110,7 +2091,6 @@ class Entreprise extends WsScore
|
||||
$anneePre = $tabTmp2['annee'];
|
||||
}
|
||||
}
|
||||
|
||||
//$tabRatiosSecteurs=array(count($tabTmp), "1 $strNaf AND annee IN ($strAnnees) ORDER BY annee DESC, id ASC");
|
||||
|
||||
$result = new RatiosResult();
|
||||
@ -2130,10 +2110,9 @@ class Entreprise extends WsScore
|
||||
debugLog('I',"Liste des Ratios demandée pour $siren RETURN",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->wsLog($page, $siren);
|
||||
$output = new RatiosReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2148,7 +2127,6 @@ class Entreprise extends WsScore
|
||||
$this->authenticate();
|
||||
if (empty($niveau)) $niveau = 3;
|
||||
if (empty($id)) $id = 0;
|
||||
$error = new ErrorType();
|
||||
$result = new Rapport();
|
||||
$filtre = 0;
|
||||
$idAnn = 0;
|
||||
@ -2169,7 +2147,6 @@ class Entreprise extends WsScore
|
||||
$result->Annonces = $this->getAnnonces($siren, $filtre, $idAnn);
|
||||
}
|
||||
$output = new RapportReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
return $output;
|
||||
}
|
||||
@ -2189,7 +2166,9 @@ class Entreprise extends WsScore
|
||||
debugLog('I',"Liste des banques demandée pour siren $siren",
|
||||
__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
if ($siren*1>1000){
|
||||
if (intval($siren)<=1000) {
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$res=$iDb->select('banques', 'codeBanque, codeGuichet, libBanqueGuichet, precis, dateSource*1 AS dateSource', "siren=$siren", false, MYSQL_ASSOC);
|
||||
$tmp=$iDb->select('fedRib', "codeBanque, codeGuichet, CONCAT(libBanque,' ',libGuichet) AS libBanqueGuichet, 0 AS precis, IF (dateInfo='0000-00-00', dateDispo*1, dateInfo*1) AS dateSource", "siren=$siren", false, MYSQL_ASSOC);
|
||||
@ -2240,15 +2219,8 @@ class Entreprise extends WsScore
|
||||
$banque->ville = $adrBanqueVille;
|
||||
$tabRet[] = $banque;
|
||||
}
|
||||
} else {
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren invalide';
|
||||
}
|
||||
debugLog('I',"Liste des banques pour siren $siren : ".count($tabRet).' banques',__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (count($tabRet)==0) {
|
||||
$error->errnum = 256454;
|
||||
$error->errmsg = 'Aucune relation bancaire en base';
|
||||
}
|
||||
|
||||
$this->wsLog('banque', $siren);
|
||||
$output = new BanquesReturn();
|
||||
$output->result = $tabRet;
|
||||
@ -2588,13 +2560,10 @@ class Entreprise extends WsScore
|
||||
$error = new StatusReturn();
|
||||
//Test connexion à la base de données
|
||||
$db = new WDB('jo');
|
||||
if ($db === false)
|
||||
{
|
||||
if ($db === false) {
|
||||
$error->statusCode = 1;
|
||||
$error->statusMsg = 'Erreur critique';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$error->statusCode = 0;
|
||||
$error->statusMsg = 'Services disponible (beta)';
|
||||
}
|
||||
|
@ -1108,7 +1108,7 @@ class ListeEtablissementsReturn
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var Etablissement[] */
|
||||
public $liste;
|
||||
public $result;
|
||||
}
|
||||
|
||||
class Etablissement
|
||||
@ -1192,8 +1192,6 @@ class Etablissement
|
||||
|
||||
class DirigeantsReturn
|
||||
{
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var Dirigeant[] */
|
||||
public $result;
|
||||
}
|
||||
@ -1638,7 +1636,7 @@ class TvaReturn
|
||||
class TribunauxReturn
|
||||
{
|
||||
/** @var Tribunal[] */
|
||||
public $tribunaux;
|
||||
public $result;
|
||||
}
|
||||
|
||||
class Tribunal
|
||||
@ -1908,19 +1906,11 @@ class InfosBourse
|
||||
}
|
||||
|
||||
class ListeBilansReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var ListeBilansResult */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class ListeBilansResult
|
||||
{
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var ListeBilans[] */
|
||||
public $liste;
|
||||
public $result;
|
||||
}
|
||||
|
||||
class ListeBilans
|
||||
@ -2250,8 +2240,6 @@ class RechercheAnnonce
|
||||
|
||||
class IndiscoreReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var Indiscore */
|
||||
public $result;
|
||||
}
|
||||
@ -2727,8 +2715,6 @@ class Scores
|
||||
|
||||
class RatiosReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var RatiosResult */
|
||||
public $result;
|
||||
}
|
||||
@ -2842,8 +2828,6 @@ class RatiosSecteur
|
||||
|
||||
class RapportReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var Rapport */
|
||||
public $result;
|
||||
}
|
||||
|
@ -79,10 +79,6 @@ Type[] = "ListeSurveillancesCsv"
|
||||
Type[] = "RechercheHistoReturn"
|
||||
Type[] = "RechercheHistoCriteres"
|
||||
Type[] = "RechercheHistoReponses"
|
||||
Type[] = "SurveillancesReturn"
|
||||
Type[] = "SurveillancesResult"
|
||||
Type[] = "SurveillancesCriteres"
|
||||
Type[] = "SurveillancesReponses"
|
||||
Type[] = "ClientReturn"
|
||||
Type[] = "ModeleUtilisateurReturn"
|
||||
Type[] = "ModeleUtilisateur"
|
||||
|
@ -1239,66 +1239,6 @@ class RechercheHistoReponses
|
||||
public $Texte;
|
||||
}
|
||||
|
||||
class SurveillancesReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var SurveillancesResult */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class SurveillancesResult
|
||||
{
|
||||
/** @var SurveillancesCriteres */
|
||||
public $criteres;
|
||||
/** @var int */
|
||||
public $nbReponses;
|
||||
/** @var int */
|
||||
public $nbReponsesTotal;
|
||||
/** @var int */
|
||||
public $duree;
|
||||
/** @var array */
|
||||
public $mots;
|
||||
/** @var SurveillancesReponses[] */
|
||||
public $reponses;
|
||||
}
|
||||
|
||||
class SurveillancesCriteres
|
||||
{
|
||||
/** @var string */
|
||||
public $siren;
|
||||
/** @var string */
|
||||
public $nic;
|
||||
/** @var string */
|
||||
public $source;
|
||||
}
|
||||
|
||||
class SurveillancesReponses
|
||||
{
|
||||
/** @var string */
|
||||
public $source;
|
||||
/** @var string */
|
||||
public $email;
|
||||
/** @var string */
|
||||
public $siren;
|
||||
/** @var string */
|
||||
public $nic;
|
||||
/** @var string */
|
||||
public $ref;
|
||||
/** @var string */
|
||||
public $dateAjout;
|
||||
/** @var string */
|
||||
public $dateDerEnvoi;
|
||||
/** @var string */
|
||||
public $encoursClient;
|
||||
/** @var string */
|
||||
public $rs;
|
||||
/** @var string */
|
||||
public $cp;
|
||||
/** @var string */
|
||||
public $ville;
|
||||
}
|
||||
|
||||
class ClientReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
|
@ -68,6 +68,7 @@ class WsScore
|
||||
|
||||
'1010' => 'Siren invalide',
|
||||
'1020' => 'Siren inexistant',
|
||||
'1030' => 'Aucun résultat pour ce siren en base',
|
||||
|
||||
'3000' => 'Service disponible',
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user