b4da2f727e
It is highly recommended not to instantiate BeSimple\SoapBundle\Soap\SoapResponse but to use the service besimple.soap.response Before: public function helloAction($name) { return new SoapResponse("Hello ".$name); } After: public function helloAction($name) { return $this ->container ->get('besimple.soap.response') ->setReturnValue("Hello ".$name) ; }
25 lines
620 B
ReStructuredText
25 lines
620 B
ReStructuredText
Array
|
|
=====
|
|
|
|
Controller
|
|
----------
|
|
|
|
.. code-block:: php
|
|
|
|
namespace My\App\Controller;
|
|
|
|
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
|
|
use Symfony\Component\DependencyInjection\ContainerAware;
|
|
|
|
class DemoController extends ContainerAware
|
|
{
|
|
/**
|
|
* @Soap\Method("hello")
|
|
* @Soap\Param("names", phpType = "string[]")
|
|
* @Soap\Result(phpType = "string")
|
|
*/
|
|
public function helloAction(array $names)
|
|
{
|
|
return $this->container->get('besimple.soap.response')->setReturnValue("Hello ".implode(', ', $names));
|
|
}
|
|
} |