/** * Creates a SoapClient with configured SoapConfig object and given additional settings. * * @param array $settings additional settings go here * * @return SoapClient * @throws InputException * @throws NoServerAvailableException * @throws \InvalidArgumentException */ public function create(array $settings = []) { // create soap settings, with given settings and platform settings $soapSettings = SoapSettings::loadFromArray($settings); // create a manager for endpoint management $manager = $this->createEndpointManager($settings); // replace the native soap client transport with a curl client $curlClient = $this->createCurlClient($soapSettings->toArray(), $manager); // build a SoapClient (extends the native soap client) $soapClient = new SoapClient($soapSettings, $manager, $curlClient); // set custom headers $soapHeaders = array_key_exists('soapHeaders', $settings) ? array_merge($settings['soapHeaders'], $this->config->getSoapHeaders()) : $this->config->getSoapHeaders(); $soapClient->__setSoapHeaders($soapHeaders); if ($this->config->hasConverter() === true) { $soapClient->setConverter($this->config->getConverter()); } if ($this->hasLogger() === true) { $soapClient->setLogger($this->logger); $this->logger->info('Created SoapClient for ' . $this->config->getPlatformConfig()->getPlatformName()); $this->logger->debug('Created SoapClient', ['SoapClient' => print_r($soapClient, true)]); $this->logger->debug('Settings', ['settings' => (array) $settings]); } return $soapClient; }
/** * @expectedException \WebservicesNl\Common\Exception\Client\InputException * @expectedExceptionMessage Not a valid timeout * * @throws InputException */ public function testSettingsConnectionTimeout() { $settings = new SoapSettings(); $settings->setConnectionTimeout('bla'); }