cancel
Showing results for 
Search instead for 
Did you mean: 

Object of class stdClass could not be converted to string

Former Member
0 Kudos

Dear all,

Im very new in PHP development and trying to consume a ASP.NET webservice.

This is my code:

<HTML>

<HEAD>

<TITLE>New Document</TITLE>

</HEAD>

<BODY>

<?php

require_once('lib/nusoap.php');

$soap = new SoapClient('https://testsoap.test.nl:446/Service1.asmx?wsdl');

try {

$result = $soap->testPhp();

echo "$result";

} catch (SoapFault $e) {

echo "Error: {$e->faultstring}";

}

?>

</BODY></HTML>

When running this, im getting this error:

PHP Catchable fatal error: Object of class stdClass could not be converted to string . on line 14.

And this is line 14 in my code:

echo "$result";

Can anyone help me with this issue?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

johna69
Product and Topic Expert
Product and Topic Expert
0 Kudos

Without knowing what version of PHP you are using and also there does not seem to be an SAP angle, have you tried var_dump() instead of echo.

e.g. var_dump($result);

http://php.net/manual/en/function.var-dump.php