public function dump(ServiceProvider $serviceProvider) { ini_set("soap.wsdl_cache", "0"); ini_set("soap.wsdl_cache_enabled", "0"); ini_set('soap.wsdl_cache_ttl', 0); $filePath = $serviceProvider->getWsdlPath(); $autodiscover = new AutoDiscover(); $autodiscover->setClass($serviceProvider->getServiceClassName())->setComplexTypeStrategy(new \Zend\Soap\Wsdl\ComplexTypeStrategy\DefaultComplexType())->setUri($serviceProvider->getUrlLocation())->setServiceName('MySoapService'); $autodiscover->dump($filePath); }
/** * @group ZF-5330 */ public function testDumpOnlyAfterGeneratedAutoDiscoverWsdl() { $server = new AutoDiscover(); $this->setExpectedException('Zend\Soap\Exception\RuntimeException', 'Cannot dump autodiscovered contents'); $server->dump(false); }
/** * @group ZF-5330 */ public function testDumpOrXmlOnlyAfterGeneratedAutoDiscoverWsdl() { $server = new AutoDiscover(); try { $server->dump(false); $this->fail(); } catch (\Exception $e) { $this->assertTrue($e instanceof AutoDiscoverException); } try { $server->toXml(); $this->fail(); } catch (\Exception $e) { $this->assertTrue($e instanceof AutoDiscoverException); } }