public function __construct(ConfigInterface $config, $wsdlUrl) { $this->config = $config; try { $this->soapClient = new SoapClient($wsdlUrl, $this->config->getOptionFeatures()); parent::__construct($wsdlUrl); } catch (SoapFault $e) { throw new Exception('Unable to load WSDL: ' . $e->getMessage(), $e->getCode(), $e); } }
public function __construct(ConfigInterface $config, $wsdlUrl) { $this->config = $config; // Never use PHP WSDL cache to when creating the SoapClient instance used to extract information. // Otherwise we risk generating code for a WSDL that is no longer valid. $options = array_merge($this->config->get('soapClientOptions'), array('cache_wsdl' => WSDL_CACHE_NONE)); try { $soapClientClass = new \ReflectionClass($this->config->get('soapClientClass')); $this->soapClient = $soapClientClass->newInstance($wsdlUrl, $options); parent::__construct($config, $wsdlUrl); // we need to pass $config for proxy settings } catch (SoapFault $e) { throw new Exception('Unable to load WSDL: ' . $e->getMessage(), $e->getCode(), $e); } }