getting an object from SoapClient

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi there,

I'm new to the SOAP  PHP5 extension. It works fine for web service  
methods that returns basic types (string,int,...). However, for methods  
that return an object of a class I defined, I can't access the object,  
though the SOAP response looks correct.

Here the received SOAP message :

<?xml version="1.0" encoding="UTF-8"?>
xmlns:SOAP-ENV=" /"
xmlns:xsd=" " xmlns:ns1=""
xmlns:xsi=" "
xmlns:SOAP-ENC=" /"
SOAP-ENV:encodingStyle=" /">
<SOAP-ENV:Body><SOAP-ENV:getOBjectResponse><return xsi:type="ns1:AUser">
<cn xsi:type="xsd:string">JACQUES LEBASTARD</cn>
<givenname xsi:type="xsd:string">Jacques</givenname>
<sn xsi:type="xsd:string">Lebastard</sn>

The returned object looks as a SoapVar where I was expecting an object  
of class 'User' (the 'AUser' given as enc_stype is the ComplexType  
defined in the WSDL):

object(SoapVar)#3 (4) {
   ["enc_type"]=> int(0)
   ["enc_value"]=> object(stdClass)#2 (4) {
     ["cn"]=> string(17) "JACQUES LEBASTARD"
     ["givenname"]=> string(7) "Jacques"
     ["sn"]=> string(9) "Lebastard"
     ["mail"]=> string(29) ""
   ["enc_stype"]=> string(5) "AUser"
   ["enc_ns"]=> string(0) ""

What did I miss in the WSDL or web service definition?

Site Timeline