#43985 [Opn->Bgs]: soap error: Object of class stdClass could not be converted to string

From: Date: Wed, 30 Jan 2008 18:40:11 +0000
Subject: #43985 [Opn->Bgs]: soap error: Object of class stdClass could not be converted to string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121796@lists.php.net to get a copy of this message
ID: 43985 User updated by: c00lways at gmail dot com Reported By: c00lways at gmail dot com -Status: Open +Status: Bogus Bug Type: SOAP related Operating System: Red Hat 3.4.5-2 / CentOS PHP Version: 5.2.5 New Comment: sorry i didn't realised the new php 5.2 doesn't accept object conversion to string if it doesn't have tostring... my problem.. :( Previous Comments: ------------------------------------------------------------------------ [2008-01-30 18:36:50] c00lways at gmail dot com Description: ------------ when i use soap to open a complex wsdl... and then pass in a stdclass object to be send as parameter... came out crash: Catchable fatal error: Object of class stdClass could not be converted to string in ... this crash is not captured by try / catch Reproduce code: --------------- $client = new SoapClient("http://demo.touricoholidays.com/ws/AmendmentServices.asmx?WSDL", Array( "trace" => 1, "exceptions" => 1, "encoding" => "ISO-8859-1" ) ); $tcost = new stdClass(); //adding this below gives similar problem... //$tcost->CostAmendObj = new stdClass(); //$tcost->CostAmendObj->IsOnlyAvailable = "true"; try { //this statement causes the error... echo "Result: " . $client->costamend( $tcost ); } catch ( Exception $e ) { var_dump( $e->getMessage() ); } Expected result: ---------------- soap response xml Actual result: -------------- Catchable fatal error: Object of class stdClass could not be converted to string in ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43985&edit=1

« previous php.bugs (#121796) next »