From: v0idnull at psikon dot com Operating system: Ubuntu PHP version: 5.2.6 PHP Bug Type: SOAP related Bug description: SoapClient tries to convert stdClass into string
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 bug report at http://bugs.php.net/?id=45975&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45975&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45975&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45975&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45975&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45975&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45975&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45975&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45975&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45975&r=support Expected behavior: http://bugs.php.net/fix.php?id=45975&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45975&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45975&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45975&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45975&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45975&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45975&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45975&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45975&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45975&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45975&r=mysqlcfg