我用zend设置了一个简单的肥皂服务器。我用我找到的一个例子。我尝试了许多解决方案,但仍然收到错误:
This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
PHP日志说
Warning: DOMDocument::saveXML() domdocument.savexml invalid character value in
/usr/share/ZendFramework-1.11.11/library/Zend/Soap/Wsdl.php on line 506
这是我的代码:
ini_set("soap.wsdl_cache_enabled", 0); // disabling WSDL cache
require 'Zend/Loader/Autoloader.php';
require 'Zend/Soap/Server.php';
require 'Zend/Soap/AutoDiscover.php';
require 'Zend/Soap/Client.php';
$wsdl_uri = 'http://MY-URL/soap.php?wsdl=1';
$wsdl = new Zend_Soap_Autodiscover();
$wsdl->setClass('MeinWebservice');
if (isset($_GET['wsdl'])) {
$wsdl->handle();
} else {
$server = new Zend_Soap_Server($wsdl_uri);
$server->setClass('MeinWebservice');
$server->handle();
}
class MeinWebservice {
/**
* Gibt den Wert mal 10 zurück
*
* @param int $inputParam
* @return int
*/
public function test1($inputParam) {
return $inputParam * 10;
}
/**
* Addiert die Werte
*
* @param int $inputParam1
* @param int $inputParam2
* @return int
*/
public function test2($inputParam1, $inputParam2) {
return $inputParam1 + $inputParam2;
}
}
我做错了什么?
嗯。
似乎已修复。 不知道为什么。 我再次设置了肥皂脚本。