notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
634 stars 122 forks source link

sometimes wsdl return "SoapFault exception: [Server] Antech service not available" #172

Open bionimic opened 5 years ago

bionimic commented 5 years ago

Hi @artisaninweb,

I'm having issue when my soapWrapper tried to get contents from wsdl url like below:

public function initiateSoapWrapper()
    {
        try {
            ini_set('soap.wsdl_cache_enabled',0);
            ini_set('soap.wsdl_cache_ttl',0);
            if (!@file_get_contents($this->getUrl())) {
                $this->soapWrapper = null;
                throw new SoapFault('Server', self::MSG_ANTECH_SERVICE_UNAVAILABLE);
            }

            $this->soapWrapper = (new SoapWrapper())->add(self::NAME, function ($service) {
                $service->wsdl($this->getUrl())
                    ->cache(self::WSDL_CACHE_DISK)
                    ->trace(true)
                    ->options([
                        'login'    => $this->username,
                        'password' => $this->password
                    ]);
            });
        } catch (SoapFault $e) {
            throw $e;
        }
    }

the url is https://dev.antechdiagnostics.com/service/services?wsdl

it always throw this error:

App\Jobs\StoreAntechResultJob: 1532b0b5-942e-40: Antech service not available
SoapFault exception: [Server] Antech service not available in /opt/vetter/core/Libraries/Antech/AntechApi.php:69
Stack trace:
#0 /opt/vetter/core/Libraries/Antech/AntechApi.php(50): App\Libraries\Antech\AntechApi->initiateSoapWrapper()
#1 /opt/vetter/lab-service/app/Jobs/StoreAntechResultJob.php(104): App\Libraries\Antech\AntechApi->__construct(Array, '1532b0b5-942e-4...')
#2 [internal function]: App\Jobs\StoreAntechResultJob->handle()
#3 /opt/vetter/lab-service/vendor/illuminate/container/BoundMethod.php(29): call_user_func_array(Array, Array)
#4 /opt/vetter/lab-service/vendor/illuminate/container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#5 /opt/vetter/lab-service/vendor/illuminate/container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Laravel\Lumen\Application), Array, Object(Closure))
#6 /opt/vetter/lab-service/vendor/illuminate/container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Laravel\Lumen\Application), Array, Array, NULL)
#7 /opt/vetter/lab-service/vendor/illuminate/bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)

Please assist. Thanks