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:
Francis Besset
2013-02-20 14:45:47 +01:00
parent 2e34b1ce1d
commit e3ddebfea4
3 changed files with 75 additions and 4 deletions

View File

@ -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