title: Is it possible to map element name to php class (SoapClient)
body: <p>Using SoapClient, is it possible to map an element name (as opposed to a type) to a php class?</p>
  
  <p>In the php manual:</p>
  
  <p><a href="http://www.php.net/manual/en/soapclient.soapclient.php" rel="nofollow">http://www.php.net/manual/en/soapclient.soapclient.php</a></p>
  
  <p>classmap is defined thus:</p>
  
  <blockquote>
    <p>The classmap option can be used to map some WSDL types to PHP classes. This option must be an array with WSDL types as keys and names of PHP classes as values. </p>
  </blockquote>
  
  <p>Is it possible to map an element if it does not have a type?</p>
  
  <p>eg.</p>
  
  <pre><code>&lt;xsd:element name="M1Response"&gt;
    &lt;xsd:complexType&gt;
      &lt;xsd:sequence&gt;
        &lt;xsd:element name="N1Response" type="bons0:R1Out"/&gt;
      &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <p>ie. I want to map the element <code>M1Response</code> to a php class</p>
  
  <p>I can map <code>N1Response</code> to a php class, but the response is like so:</p>
  
  <pre><code>stdClass Object
  (
      [N1Response] =&gt; MyPHPClassResponse Object
          (
              ...
          )
  )
  </code></pre>
  
  <p>which almost defeats the purpose of the classmap functionality.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>