Added SoapResponseListener
This listener allow return a raw result from the action. Before: /** * @Soap\Method("hello") * @Soap\Param("name", phpType = "string") * @Soap\Result(phpType = "string") */ public function helloAction($name) { return $this->container->get('besimple.soap.response')->setReturnValue(sprintf('Hello %s!', $name)); } After: /** * @Soap\Method("hello") * @Soap\Param("name", phpType = "string") * @Soap\Result(phpType = "string") */ public function helloAction($name) { return sprintf('Hello %s!', $name); }
This commit is contained in:
@ -34,7 +34,7 @@ Annotations for Controllers
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace My\App\Controller;
|
||||
namespace Acme\DemoBundle\Controller;
|
||||
|
||||
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
|
||||
use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
@ -48,7 +48,17 @@ Annotations for Controllers
|
||||
*/
|
||||
public function helloAction($name)
|
||||
{
|
||||
return $this->container->get('besimple.soap.response')->setReturnValue(sprintf('Hello %s!', $name));
|
||||
return sprintf('Hello %s!', $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Soap\Method("goodbye")
|
||||
* @Soap\Param("name", phpType = "string")
|
||||
* @Soap\Result(phpType = "string")
|
||||
*/
|
||||
public function goodbyeAction($name)
|
||||
{
|
||||
return $this->container->get('besimple.soap.response')->setReturnValue(sprintf('Goodbye %s!', $name));
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,5 +67,4 @@ Get your WSDL
|
||||
|
||||
To access your WSDL go to the following address: http://localhost/app_dev.php/ws/DemoApi?wsdl
|
||||
|
||||
To read the WSDL in your browser you can call this address: http://localhost/app_dev.php/ws/DemoApi
|
||||
|
||||
To read the WSDL in your browser you can call this address (without `wsdl` parameter): http://localhost/app_dev.php/ws/DemoApi
|
||||
|
Reference in New Issue
Block a user