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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 23:03:35 2021 UTC