我正在测试我在我的网站空间上制作的服务器和客户端。
当我试图调用一个定义在ServerMap类中的简单的"testServer“函数时,我得到”看起来我们没有得到XML文档“。
..?
我在客户端调用了getFunctions,而testServer是一个有效的函数。我尝试捕获所有异常,然后调用__getLastResponseHeaders()和__getLastResponse。
标题:
string(348) "HTTP/1.1 200 OK
Date: Tue, 23 Jun 2009 19:36:29 GMT
Server: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
X-Powered-By: PHP/5.2.9
Cache-Control: max-age=1
Expires: Tue, 23 Jun 2009 19:36:30 GMT
Vary: Accept-Encoding
Content-Length: 1574
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
"响应:
string(1574) "DEBUG HEADER : This is a cached page !
"如果我查看响应的源html,它实际上是:
string(1574) "DEBUG HEADER : This is a cached page !<?xml version="1.0"?>
<A lot of xml that looks pretty much like my WSDL file that my Zend_Soap_AutoDiscover generates>那么到底是怎么回事呢?我在网上搜索了一下,并没有找到任何可靠的解决方案。我在我的..前没有空格。
发布于 2009-06-23 19:46:04
如果要输出到浏览器,则会隐藏xml,因为它位于。浏览器会忽略他们不理解的标签。
执行echo htmlentities($output);以查看xml标记。
发布于 2009-08-25 23:00:06
不确定您的问题是什么,但我可以提供一些代码,我知道这些代码对我们使用Zend Framework1.8x作为silverlight和WCF的后端SOAP服务有效。此服务简单地获取2个整数,将它们相加并返回结果。你能得到的最简单。
控制器类示例:
class SoapController extends Zend_Controller_Action {
/*
* SOAP server action
*/
public function indexAction() {
$request = $this->getRequest();
if ($request->getParam('wsdl') !== null) {
$wsdl = new Zend_Soap_AutoDiscover();
$wsdl->setClass('SoapMath');
$wsdl->handle();
}
else {
$module = $request->getModuleName();
$controller = $request->getControllerName();
$uri = 'http://' . Zend_Registry::get('fullUrl') . '/' . $module . '/' . $controller . '?wsdl';
$server = new Zend_Soap_Server($uri);
$server->setClass('SoapMath');
$server->handle();
}
exit;
}
}而实际的工作是由“SoapMath”完成的,其定义如下:
class SoapMath {
public function add($a,$b) {
return ($a + $b);
}
}https://stackoverflow.com/questions/1034750
复制相似问题