diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php index 256b483c4f377a470b2175096024ebee1b26eeaf..4652e2a07b1ddc65f5776a4538ec34d4ab382db4 100644 --- a/interface/lib/classes/validate_client.inc.php +++ b/interface/lib/classes/validate_client.inc.php @@ -174,10 +174,8 @@ class validate_client { } } } - - $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"); - - if($client){ + try { + $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"); $params = array('countryCode' => $cc, 'vatNumber' => $vn); try{ $r = $client->checkVat($params); @@ -191,12 +189,12 @@ class validate_client { } } - // This foreach shows every single line of the returned information - /* - foreach($r as $k=>$prop){ - echo $k . ': ' . $prop; - } - */ + // This foreach shows every single line of the returned information + /* + foreach($r as $k=>$prop){ + echo $k . ': ' . $prop; + } + */ } catch(SoapFault $e) { //echo 'Error, see message: '.$e->faultstring; @@ -217,7 +215,7 @@ class validate_client { break; } } - } else { + } catch(SoapFault $e){ // Connection to host not possible, europe.eu down? // this shouldn't be the user's fault, so we return no error }