yii2-soap-server
yii2-soap-server copied to clipboard
Complex Type as input parameter
Hey guys.
I expect the following operation in the controller class to work:
/**
* Returns hello and the name that you gave
*
* @param app\models\Post $post
* @return string
* @soap
*/
public function receive($post)
{
return 'Hello ' . $post->title;
}
The WSDL is generated correcly, here it is:
https://gist.github.com/jonvargas/054d9cac7a7c4e51e527
But SoapUI complains:
"The value 'app\models\Post' is an invalid name."
Is this the proper way to generate a service operation that expects a complex type? Could you detail a bit more?
Thanks in advance
The truth is I've also stumbled on this and could never find a proper solution. My solution involved escaping the backspaces in the WSDL generator but I wasn't successful.
Please check if this PR solves your issue https://github.com/subdee/yii2-soap-server/pull/9
I know it's too late, but anyway, my solving:
/**
* Returns hello and the name that you gave
*
* @param object $post Object of any type
* @return string
* @soap
*/
public function receive($post)
{
return 'Hello ' . $post->title;
}