Soap Try-Catch

This commit is contained in:
Michael RICOIS 2017-02-14 11:40:29 +01:00
parent 4a1ea34d41
commit 511dfa92d7

View File

@ -728,40 +728,33 @@ class SaisieController extends Zend_Controller_Action
if ($sourceNum === false) {
echo "Source inconnu"; exit;
}
// Version new
$ws = new Scores_Ws_Client('saisie', '0.2');
$params = new stdClass();
$params->source = $sourceNum;
$params->idAnn = $idan;
$params->siretIn = $siretIn;
$params->siretOut = $siretOut;
$devp=array('sourceNum' => $sourceNum,'idan' => $idan,'siretIn' => $siretIn, 'siretOut' => $siretOut);
$infos = $ws->dupliqueAnnonce($params);
if ($infos === false) {
echo 'Erreur du Webservice';
$this->forward('soap', 'error');
try {
$infos = $ws->dupliqueAnnonce($params);
} catch(SoapFault $e) {
echo $e->getMessage;
}
echo $infos->error->errmsg;
if ($infos === false) {
echo "Erreur.";
} else {
echo "Annonce dupliqué.",
}
break;
case 'edit':
//@todo : sauvegarder
$siret = $request->getParam('siret');
$idan = $request->getParam('idan');
print_r($request->getParams());
/*
echo saisie_save($siret, '', $tabInfo);
echo '<br/>';
*/
break;
case 'even':