By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,616 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,616 IT Pros & Developers. It's quick & easy.

getting an object from SoapClient

P: n/a

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 :

Response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1=""
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<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>
<mail xsi:type="xsd:string">ja***************@evidian.co m</mail>
</return></SOAP-ENV:getOBjectResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

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) "ja***************@evidian.com"
}
["enc_stype"]=> string(5) "AUser"
["enc_ns"]=> string(0) ""
}

What did I miss in the WSDL or web service definition?
Jun 20 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.