utilisation du logger, issue #0000336
This commit is contained in:
parent
5086e13bd3
commit
004ab534a5
@ -12,38 +12,73 @@ class WsEntreprise {
|
||||
* @param string $siret
|
||||
* @param integer $id
|
||||
* @param boolean $forceVerif
|
||||
* @return IdentiteReturnType
|
||||
* @return IdentiteReturnType
|
||||
*/
|
||||
function getIdentite($siret, $id = 0, $forceVerif = false) {
|
||||
|
||||
// test authentification, récupération des données d'authentification
|
||||
//$_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $_SERVER['REMOTE_ADDR']
|
||||
|
||||
$client = new SoapClient( null,
|
||||
array( 'trace' => 1,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'location' => WEBSERVICE_URL,
|
||||
'uri' => WEBSERVICE_URI,
|
||||
'login' => $_SERVER['PHP_AUTH_USER'],
|
||||
'password' => $_SERVER['PHP_AUTH_PW']
|
||||
));
|
||||
|
||||
//Enregistrement des accès à la requête getIdentite
|
||||
Zend_Registry::get('log')->info("getIdentite - ip:".
|
||||
$_SERVER['REMOTE_ADDR'].", login:".$_SERVER['PHP_AUTH_USER'].
|
||||
", pass:".$_SERVER['PHP_AUTH_PW']);
|
||||
//Connexion aux webservices V1
|
||||
try {
|
||||
$client = new SoapClient( null,
|
||||
array( 'trace' => 1,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'location' => WEBSERVICE_URL,
|
||||
'uri' => WEBSERVICE_URI,
|
||||
'login' => $_SERVER['PHP_AUTH_USER'],
|
||||
'password' => $_SERVER['PHP_AUTH_PW']
|
||||
));
|
||||
$O = $client->getIdentite($siret, $idEntreprise, $forceVerif);
|
||||
} catch (SoapFault $fault) {
|
||||
file_put_contents('error.txt', 'error');
|
||||
Zend_Registry::get('log')->err("getIdentite($siret, $idEntreprise) - ".serialize($fault));
|
||||
}
|
||||
//Gestion du retour
|
||||
$error = new ErrorType();
|
||||
$error = array_to_object($O['error']);
|
||||
|
||||
$result = new IdentiteResultType();
|
||||
$result = array_to_object($O['result']);
|
||||
|
||||
$outputParams = new IdentiteReturnType();
|
||||
$outputParams->error = $error;
|
||||
$outputParams->result = $result;
|
||||
return $outputParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche
|
||||
* @param RechercheEntrepriseType $criteres
|
||||
* @void
|
||||
*/
|
||||
function rechercheEntreprise($criteres){
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$O = $client->searchNomAdr($raisonSociale, $numVoie.' '.$libVoie,
|
||||
$cp, $ville, false, false, $position,
|
||||
$tabInfo['nbReponses'], 200, false, false,
|
||||
$naf);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le status du webservice
|
||||
* @return StatusResultType
|
||||
*/
|
||||
function status(){
|
||||
/* @todo tester les différents éléments qui peuvent conduire à un problème dans les services
|
||||
* Tel que la connexion à la base de données
|
||||
* Accès FTP, Accès HTTP, Accès Système de fichier manquant
|
||||
*/
|
||||
$error = new StatusResultTypes();
|
||||
$error->errCode = 0;
|
||||
$error->errMsg = 'Services disponible';
|
||||
return $error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user