使用Zend Soap类和自动WSDL

时间:2010-04-12 16:25:00

标签: php zend-framework soap zend-soap

有点奇怪。 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中显示消息'Invalid 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 ZF 1.10.0

1 个答案:

答案 0 :(得分:0)

来自eAccelerator的所有问题