Php Zend_Soap_服务器返回一条空Soap消息
我创建的Zend_Soap_服务器有问题。不知何故,服务器返回了以下内容:Php Zend_Soap_服务器返回一条空Soap消息,php,web-services,zend-framework,soap,wsdl,Php,Web Services,Zend Framework,Soap,Wsdl,我创建的Zend_Soap_服务器有问题。不知何故,服务器返回了以下内容: HTTP/1.1 202 Accepted Date: Sat, 14 Jun 2014 07:39:06 GMT Server: Apache/2.2.22 (Debian) X-Powered-By: PHP/5.4.4-14+deb7u10 Content-Length: 0 Vary: Accept-Encoding Connection: close Content-Type: text/html 问题是,它
HTTP/1.1 202 Accepted
Date: Sat, 14 Jun 2014 07:39:06 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.4-14+deb7u10
Content-Length: 0
Vary: Accept-Encoding
Connection: close
Content-Type: text/html
问题是,它应该有所反应。我的意思是,我应该得到一个标识符(见下文)
我所拥有的代码:
class MyShorts {
[...]
/**
* Store a new URL into the database.
*
* @param string The URL to store
*
* @return string the unique identifier for this URL
*
* @exception for database errors.
*/
public function store($url) {
$db = $this->getDb();
while ( true ) {
try {
$identifier = $this->getRandomIdentifier(5);
$db->insert('urls', array('identifier' => $identifier,
'long' => $url,
'created' => new Zend_Db_Expr('NOW()'),
));
return $identifier;
}
catch( Exception $e ) {
throw $e;
}
}
return '';
}
正如您在这里看到的,它在数据库中存储一个url,并返回标识符。从我所看到的是,在数据库中,它被正确地存储。所以打电话和其他事情都很好
只是我没有找回标识符。怎么会这样
谢谢
顺便说一句,我如何处理传入的请求:
$soap = new Zend_Soap_Server($WSDL);
$soap->setClass('MyShorts');
$soap->handle();
不知何故,上述方法不起作用。 然而,有效的方法是:
$soap = new Zend_Soap_Server(null, array('uri' => $WSDL));
显然,$WSDL是soap基url的url,不再是WSDL了