title: PHP SOAP Procedure 'functionName' not present
body: <p>I'm writing a SOAP application in Symfony and for all my request I'm getting an error <code>Procedure 'getClusterName' not present</code>.</p>
  
  <p>Strange thing is that when I create a test SOAP application in pure PHP, it works fine, but the same code in Symfony returns an error.</p>
  
  <p>Another strange thing is that when in the SOAP server code I list available service functions with <code>$server-&gt;getFunctions()</code>, it returns array of the service functions and <code>getClusterName</code> is in that array. So the function is known to the server, but it can't call it.</p>
  
  <p>When writing the service in Symfony I followed <a href="http://symfony.com/doc/current/cookbook/web_services/php_soap_extension.html" rel="noreferrer">this article</a> and here is my code:</p>
  
  <p><strong>Client</strong>:</p>
  
  <pre><code>namespace Prj\SoapBundle\Controller;
  
  class SoapController extends Controller
  {
      public function indexAction()
      {
          $client = new \SoapClient('http://localhost/test.wsdl');
          $client-&gt;getClusterName();
  </code></pre>
  
  <p><strong>Server</strong>:</p>
  
  <pre><code>namespace Prj\SoapBundle\Controller;
  
  class SoapController extends Controller
  {
      public function indexAction()
      {
      ini_set("soap.wsdl_cache_enabled", "0");
      $server = new \SoapServer($this-&gt;container-&gt;getParameter('wsdl'));
      $server-&gt;setClass('SoapBundle\HelloService');
      $server-&gt;handle();
  </code></pre>
  
  <p><strong>Service</strong>:</p>
  
  <pre><code>namespace Prj\SoapBundle;
  
  class HelloService
  {
      public function getClusterName() 
      {
          return '&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;root&gt;Hello!&lt;/root&gt;';
      }
  }
  </code></pre>
  
  <p>*.wsdl file seems to be correct because it binds the call with controller and works fine with vanilla PHP service.</p>
  
  <p>On Internet this error usually explained by cached wsdl, but this is handled here in server code by setting <code>soap.wsdl_cache_enabled</code> parameter to zero.</p>