ID: 45975 Updated by: [email protected] Reported By: v0idnull at psikon dot com -Status: Open +Status: Feedback Bug Type: SOAP related Operating System: Ubuntu PHP Version: 5.2.6 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2008-09-02 16:05:15] v0idnull at psikon dot com Description: ------------ Call a webservice method. Method returns one value, a string. SoapClient internally tries to convert an instance of stdClass into a string before trying to return the value, thus nothing works. Reproduce code: --------------- $packet = array('sessionToken' => $this->searchAuth, 'userId' => '-1', 'expirationDate' => '2008-11-01'); // $this->soap is instance of SoapClient $results = $this->soap->__soapCall('GenerateToken',array($packet)); var_dump($results); Webservice returns: <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GenerateTokenResponse xmlns="~/WebServices/"> <GenerateTokenResult>string</GenerateTokenResult> </GenerateTokenResponse> </soap12:Body> </soap12:Envelope> Expected result: ---------------- A string containing the value of "GeneratTokenResult" OR class stdClass { public $GenerateTokenResult = 'someKindOfToken'; } Actual result: -------------- Catchable fatal error: Object of class stdClass could not be converted to string error is thrown on the line with __soapCall(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45975&edit=1
