Re: [SOAP] Handling SOAP answers

From: Date: Sun, 29 Dec 2002 21:10:48 +0000
Subject: Re: [SOAP] Handling SOAP answers
References: 1  Groups: php.pear.dev php.soap 
Request: Send a blank email to pear-dev+get-11930@lists.php.net to get a copy of this message
Klaasjan Tukker wrote:
Given a server and client (code below): How do I convert the answer of the "echoStruct" (input is a SoapStruct-Object), back into an SoapStruct? The current response is an "stdClass" object.
$struct = new SOAPStruct('test string',123,123.123); $options = array('namespace' => 'urn:SOAP_Example_Server',
                 'trace' => 1);
$client->_auto_translation = true;
    $result = $client->call("echoStruct",$struct,$options);
echo "CLASS: ".get_class($result)."\n";
_auto_translation will take any soap type and create an instance of a class with the same name if one has been defined. Or you can explicitly set classes: $client->__set_type_translation('{namespace}SoapStruct'); (namespace is what the namespace would be defined as in the wsdl) Shane

« previous php.pear.dev (#11930) next »