php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43985 soap error: Object of class stdClass could not be converted to string
Submitted: 2008-01-30 18:36 UTC Modified: 2008-01-30 18:40 UTC
From: c00lways at gmail dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.5 OS: Red Hat 3.4.5-2 / CentOS
Private report: No CVE-ID: None
 [2008-01-30 18:36 UTC] 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 ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-30 18:40 UTC] c00lways at gmail dot com
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..

:(
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC