/**
  * Proxy to WSDL dump function
  *
  * @param string $filename
  */
 public function dump($filename)
 {
     if ($this->_wsdl !== null) {
         return $this->_wsdl->dump($filename);
     } else {
         throw new Exception\RuntimeException('Cannot dump autodiscovered contents, WSDL file has not been generated yet.');
     }
 }
Exemple #2
0
 function testDump()
 {
     $wsdl = new Wsdl('MyService', 'http://localhost/MyService.php');
     ob_start();
     $wsdl->dump();
     $wsdlDump = ob_get_clean();
     $this->assertEquals($this->sanitizeWsdlXmlOutputForOsCompability($wsdlDump), '<?xml version="1.0"?>' . '<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" ' . 'xmlns:tns="http://localhost/MyService.php" ' . 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' . 'xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" ' . 'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ' . 'name="MyService" targetNamespace="http://localhost/MyService.php"/>');
     $wsdl->dump(__DIR__ . '/TestAsset/dumped.wsdl');
     $dumpedContent = file_get_contents(__DIR__ . '/TestAsset/dumped.wsdl');
     $this->assertEquals($this->sanitizeWsdlXmlOutputForOsCompability($dumpedContent), '<?xml version="1.0"?>' . '<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" ' . 'xmlns:tns="http://localhost/MyService.php" ' . 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' . 'xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" ' . 'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ' . 'name="MyService" targetNamespace="http://localhost/MyService.php"/>');
     unlink(__DIR__ . '/TestAsset/dumped.wsdl');
 }