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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: c00lways at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 05:01:28 2025 UTC