Esempio n. 1
0
 /**
  * Handle the Request
  *
  * @param string $request A non-standard request - Not Used
  */
 public function handle($request = false)
 {
     if (!headers_sent()) {
         header('Content-Type: text/xml');
     }
     $this->_wsdl->dump();
 }
Esempio n. 2
0
 /**
  * Proxy to WSDL dump function
  *
  * @param string $filename
  * @return boolean
  * @throws Zend_Soap_AutoDiscover_Exception
  */
 public function dump($filename)
 {
     if ($this->_wsdl !== null) {
         return $this->_wsdl->dump($filename);
     } else {
         /**
          * @see Zend_Soap_AutoDiscover_Exception
          */
         throw new Zend_Soap_AutoDiscover_Exception("Cannot dump autodiscovered contents, WSDL file has not been generated yet.");
     }
 }
Esempio n. 3
0
 /**
  * Proxy to WSDL dump function
  *
  * @param string $filename
  */
 public function dump($filename)
 {
     if ($this->_wsdl !== null) {
         return $this->_wsdl->dump($filename);
     } else {
         /**
          * @see Zend_Soap_AutoDiscover_Exception
          */
         require_once "wsp/class/webservice/Soap/wsp/class/webservice/Exception.php";
         throw new Zend_Soap_AutoDiscover_Exception("Cannot dump autodiscovered contents, WSDL file has not been generated yet.");
     }
 }
Esempio n. 4
0
    function testDump()
    {
        $wsdl = new Zend_Soap_Wsdl('MyService', 'http://localhost/MyService.php');
        
        ob_start();
        $wsdl->dump();
        $wsdlDump = ob_get_contents();
        ob_end_clean();
        
        $this->assertEquals($wsdlDump, 
                            '<?xml version="1.0"?>' . PHP_EOL .
                            '<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/" '
                               . 'name="MyService" targetNamespace="http://localhost/MyService.php"/>' . PHP_EOL);

        $wsdl->dump(dirname(__FILE__) . '/_files/dumped.wsdl');
        $dumpedContent = file_get_contents(dirname(__FILE__) . '/_files/dumped.wsdl');
        
        $this->assertEquals($dumpedContent, 
                            '<?xml version="1.0"?>' . PHP_EOL .
                            '<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/" '
                               . 'name="MyService" targetNamespace="http://localhost/MyService.php"/>' . PHP_EOL);
        
        unlink(dirname(__FILE__) . '/_files/dumped.wsdl');
    }