title: PHP/SOAP Uncaught SoapFault exception: Call to undefined method
body: <p>I'm trying to make a very small SOAP system working, but I'm struggling with a (small) problem for a few days and Google couldn't help me neither...</p>
  
  <p>What I want to do: I want to do some things on a few variables, which I'm passing in a class. 
  Problem: I want to use the incoming class on my server.php file as an Object. But that's not possible.</p>
  
  <p>My server PHP file:</p>
  
  <pre><code>class Lid
  {
      public $NumberOfYears; //this one is public for example purpose only
      private $tew;
      private $School;
      private $Price;
  
      public function __construct($dump){
          $this-&gt;tew = "dump:".$dump;
      }
  
      public function getPrice(){
          return $this-&gt;Price;
      }
  }
  class Functies{
      public function __construct(Lid $Lid){
              $Lid-&gt;getPrice();   //What I want to do
          return new Lid($Lid-&gt;NumberOfYears);
      }
  }
  
  $classmap = array('Lid'=&gt;'Lid');
  $server = new SoapServer(NULL,
      array(
          'classmap'=&gt;$classmap, 
              'uri' =&gt; "http://127.0.0.1/ns/soap/")
      );
  $server-&gt;setClass("Functies");
  $server-&gt;handle();
  </code></pre>
  
  <p>The class "Functies" has all the methods I want to export via SOAP. I'm using the transport class Lid as an Argument. What I actually want to do is calling methods on the incoming class $Lid.
  When I try to run the client script, it is returning the following error:
  <code>Uncaught SoapFault exception: [SOAP-ENV:Server] Call to undefined method stdClass::getPrice()</code></p>
  
  <p>I understand the problem. PHP thinks that the argument $Lid is a class, and not an object.</p>
  
  <p>So, my questions:</p>
  
  <ol>
  <li>How can I make $Lid an object?</li>
  <li>How can I access my private / public variables? I tried to do this via <code>$Lid-&gt;NumberOfYears</code> but that's just returning an empty string.</li>
  </ol>
  
  <p>Thanks in advance</p>