protected function _parseConfig(array $options = [])
    {
        if (!class_exists('SoapClient')) {
            $this->handleError('Class SoapClient not found, please enable Soap extensions');
        }

        $opts = [
            'http' => [
                'user_agent' => $this->getConfig('userAgent')
            ]
        ];

        $opts += $options;

        $context = stream_context_create($opts);
        $config = [
            'trace' => $this->debug,
            'stream_context' => $context,
            'cache_wsdl' => WSDL_CACHE_NONE
        ];
        if (!empty($this->getConfig('location'))) {
            $config['location'] = $this->getConfig('location');
        }
        if (!empty($this->getConfig('uri'))) {
            $config['uri'] = $this->getConfig('uri');
        }
        if (!empty($this->getConfig('login'))) {
            $config['login'] = $this->getConfig('login');
            $config['password'] = $this->getConfig('password');
            $config['authentication'] = $this->getConfig('authentication');
        }
        if (!empty($this->getConfig('soap_version'))) {
            $config['soap_version'] = $this->getConfig('soap_version');
        }

        return $config;
    }