title: Soap server Symfony how to set response
body: <p>I am trying to implement a very simple soap call in Symfony3.
  It works perfectly but it return nothing.</p>
  
  <p>In my controller I just call it like this</p>
  
  <pre><code>public function indexAction()
  {
      $server = new \SoapServer($this-&gt;get('kernel')-&gt;getRootDir()."/../web/soap/test.wsdl");
      $server-&gt;setObject($this-&gt;get('serv.soapservice'));
  
      $response = new Response();
      $response-&gt;headers-&gt;set('Content-Type', 'text/xml; charset=ISO-8859-1');
  
      ob_start();
      $server-&gt;handle();
      $response-&gt;setContent(ob_get_clean());
  
      return $response;
  }
  </code></pre>
  
  <p>And the called function looks like this</p>
  
  <pre><code>public function hello($param)
  {
      return 'Hello, '.$param-&gt;name;
  }
  </code></pre>
  
  <p>I tried it with SoapUI and it works perfectly, but the soap return is like this</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/symfony/test/web/app_dev.php/en/soap"&gt;
      &lt;SOAP-ENV:Body&gt;
         &lt;ns1:helloResponse/&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>It doesn't return the response of the function like this</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/symfony/test/web/app_dev.php/en/soap"&gt;
      &lt;SOAP-ENV:Body&gt;
         &lt;ns1:helloResponse&gt;
             &lt;out&gt;Hello John&lt;/out&gt;
         &lt;ns1:helloResponse/&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>How can I return it?</p>