source/Core/OnlineVatIdCheck.php
protected function _checkOnline($oCheckVat)
    {
        if ($this->_isServiceAvailable()) {
            $iTryMoreCnt = self::BUSY_RETRY_CNT;

            //T2009-07-02
            //how long socket should wait for server RESPONSE
            ini_set('default_socket_timeout', 5);

            // setting local error handler to catch possible soap errors
            set_error_handler([$this, 'catchWarning'], E_WARNING);

            do {
                try {
                    //connection_timeout = how long we should wait to CONNECT to wsdl server
                    $oSoapClient = new SoapClient($this->getWsdlUrl(), ["connection_timeout" => 5]);
                    $this->setError('');
                    $oRes = $oSoapClient->checkVat($oCheckVat);
                    $iTryMoreCnt = 0;
                } catch (SoapFault $e) {
                    $this->setError($e->faultstring);
                    if ($this->getError() == "SERVER_BUSY") {
                        usleep(self::BUSY_RETRY_WAITUSEC);
                    } else {
                        $iTryMoreCnt = 0;
                    }
                }
            } while (0 < $iTryMoreCnt--);

            // restoring previous error handler
            restore_error_handler();

            return (bool) $oRes->valid;
        } else {
            $this->setError("SERVICE_UNREACHABLE");

            return false;
        }
    }
protected function _checkOnline($oCheckVat)
    {
        if ($this->_isServiceAvailable()) {
            $iTryMoreCnt = self::BUSY_RETRY_CNT;

            //T2009-07-02
            //how long socket should wait for server RESPONSE
            ini_set('default_socket_timeout', 5);

            // setting local error handler to catch possible soap errors
            set_error_handler([$this, 'catchWarning'], E_WARNING);

            do {
                try {
                    //connection_timeout = how long we should wait to CONNECT to wsdl server
                    $oSoapClient = new SoapClient($this->getWsdlUrl(), ["connection_timeout" => 5]);
                    $this->setError('');
                    $oRes = $oSoapClient->checkVat($oCheckVat);
                    $iTryMoreCnt = 0;
                } catch (SoapFault $e) {
                    $this->setError($e->faultstring);
                    if ($this->getError() == "SERVER_BUSY") {
                        usleep(self::BUSY_RETRY_WAITUSEC);
                    } else {
                        $iTryMoreCnt = 0;
                    }
                }
            } while (0 < $iTryMoreCnt--);

            // restoring previous error handler
            restore_error_handler();

            return (bool) $oRes->valid;
        } else {
            $this->setError("SERVICE_UNREACHABLE");

            return false;
        }
    }
protected function _checkOnline ( $ oCheckVat ) { if ( $ this -> _isServiceAvailable ( ) ) { $ iTryMoreCnt = self :: BUSY_RETRY_CNT ; //T2009-07-02 //how long socket should wait for server RESPONSE ini_set ( 'default_socket_timeout' , 5 ) ; // setting local error handler to catch possible soap errors set_error_handler ( [ $ this , 'catchWarning' ] , E_WARNING ) ; do { try { //connection_timeout = how long we should wait to CONNECT to wsdl server $ oSoapClient = new SoapClient ( $ this -> getWsdlUrl ( ) , [ "connection_timeout" => 5 ] ) ; $ this -> setError ( '' ) ; $ oRes = $ oSoapClient -> checkVat ( $ oCheckVat ) ; $ iTryMoreCnt = 0 ; } catch ( SoapFault $ e ) { $ this -> setError ( $ e -> faultstring ) ; if ( $ this -> getError ( ) == "SERVER_BUSY" ) { usleep ( self :: BUSY_RETRY_WAITUSEC ) ; } else { $ iTryMoreCnt = 0 ; } } } while ( 0 < $ iTryMoreCnt -- ) ; // restoring previous error handler restore_error_handler ( ) ; return ( bool ) $ oRes -> valid ; } else { $ this -> setError ( "SERVICE_UNREACHABLE" ) ; return false ; } }
Checks online if USt.ID number is valid.
Returns true on success. On error sets error value.

@param object $oCheckVat vat object

@return bool
Checks online if USt . ID number is valid . Returns true on success . On error sets error value .