Zend Soap 中的复杂类型
我正在尝试将用 NuSOAP 编写的现有 Web 服务移植到 Zend Framework。
我能够向服务添加复杂类型,但无法在函数中检索该值。这里有一些代码可以让您更好地理解。
控制器:
private $_WSDL_URI="http://webservice/?wsdl";
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
if(isset($_GET['wsdl'])) {
//return the WSDL
$this->hadleWSDL();
} else {
//handle SOAP request
$this->handleSOAP();
}
}
private function hadleWSDL() {
$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autodiscover->setClass('Webservice');
$autodiscover->handle();
}
private function handleSOAP() {
$soap = new Zend_Soap_Server($this->_WSDL_URI);
$soap->setClass('Webservice');
$soap->handle();
}
Webservice 类:
/**
* desc
*
* @param Type_Authentication
* @return Array
*/
public function get_vehicle_type($authentication) {
var_dump($authentication);
die();
return array('test', 'tsest');
}
Type_Authentication 类:
/** @var string */
public $username;
/** @var string */
public $password;
在上面的代码中,$authentication 返回
object(stdClass)#25 (0) {
}
我做错了什么?
I'm trying to port an existing web service wrote with NuSOAP to Zend Framework.
I was able to add a complex type to the service, but I cannot retrieve that value in my function. Here's some code to make you understand better.
The controller:
private $_WSDL_URI="http://webservice/?wsdl";
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
if(isset($_GET['wsdl'])) {
//return the WSDL
$this->hadleWSDL();
} else {
//handle SOAP request
$this->handleSOAP();
}
}
private function hadleWSDL() {
$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autodiscover->setClass('Webservice');
$autodiscover->handle();
}
private function handleSOAP() {
$soap = new Zend_Soap_Server($this->_WSDL_URI);
$soap->setClass('Webservice');
$soap->handle();
}
The Webservice class:
/**
* desc
*
* @param Type_Authentication
* @return Array
*/
public function get_vehicle_type($authentication) {
var_dump($authentication);
die();
return array('test', 'tsest');
}
The Type_Authentication class:
/** @var string */
public $username;
/** @var string */
public $password;
In the code above, $authentication returns
object(stdClass)#25 (0) {
}
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论