yii2-soap-server icon indicating copy to clipboard operation
yii2-soap-server copied to clipboard

Complex Type as input parameter

Open jonvargas opened this issue 11 years ago • 3 comments

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

jonvargas avatar Aug 05 '14 08:08 jonvargas

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.

subdee avatar Aug 05 '14 08:08 subdee

Please check if this PR solves your issue https://github.com/subdee/yii2-soap-server/pull/9

subdee avatar Oct 23 '14 08:10 subdee

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; }

Ant0ny avatar Jun 18 '21 17:06 Ant0ny