使用 Zend Soap 类和自动 WSDL
非常奇怪的事情。 WSDL 文件生成良好。这是
class SoapTest
{
/**
* Prapapapapapapap
* @return string Bls bls
*/
public function getList()
{
return "code";
}
}
WSDL、服务器、客户端
if (isset($_REQUEST['wsdl'])) {
$ad = new Zend_Soap_AutoDiscover();
$ad->setClass('SoapTest');
$ad->handle();
} else if ( isset($_REQUEST['client']) ) {
$client = new Zend_Soap_Client("http://localhost/test.php");
echo $client->getList();
}
else {
$server = new Zend_Soap_Server("http://localhost/test.php?wsdl");
$server->setClass('SoapTest');
$server->handle();
}
自动生成的 WSDL 的源简单类代码,SoapServer 有一些问题
未捕获异常“Zend_Soap_Server_Exception”,Z:\home\localhost\www\Zend\Soap\Server.php 中带有消息“无效 XML” :694 堆栈跟踪: #0 Z:\home\localhost\www\Zend\Soap\Server.php(817): Zend_Soap_Server->_setRequest('') #1 Z:\home\localhost\www\test.php (54): Zend_Soap_Server->handle() #2 {main} 在第 694 行的 Z:\home\localhost\www\Zend\Soap\Server.php 中抛出
我只是不明白为什么? WSDL 中没有额外的符号(如空格或 \n),所有标头均已指定。
PHP 5.2.12 采埃孚1.10.0
Something very strange.
WSDL file generates fine. Here is source simple class
class SoapTest
{
/**
* Prapapapapapapap
* @return string Bls bls
*/
public function getList()
{
return "code";
}
}
Code for WSDL, Server, Client
if (isset($_REQUEST['wsdl'])) {
$ad = new Zend_Soap_AutoDiscover();
$ad->setClass('SoapTest');
$ad->handle();
} else if ( isset($_REQUEST['client']) ) {
$client = new Zend_Soap_Client("http://localhost/test.php");
echo $client->getList();
}
else {
$server = new Zend_Soap_Server("http://localhost/test.php?wsdl");
$server->setClass('SoapTest');
$server->handle();
}
Autogenerated WSDL have some problems with SoapServer
Uncaught exception 'Zend_Soap_Server_Exception' with message 'Invalid XML' in Z:\home\localhost\www\Zend\Soap\Server.php:694 Stack trace: #0 Z:\home\localhost\www\Zend\Soap\Server.php(817): Zend_Soap_Server->_setRequest('') #1 Z:\home\localhost\www\test.php(54): Zend_Soap_Server->handle() #2 {main} thrown in Z:\home\localhost\www\Zend\Soap\Server.php on line 694
I just don't understand why? There is no extra symbol in WSDL like space or \n, all headers are specified.
Php 5.2.12
ZF 1.10.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
eAccelerator 的所有问题
all problems from eAccelerator