It can be a lot of things. Maybe somewhere you are doing (string) $classObject, or you are returning an $classObject but you have return type defined on that method :string, or concatenating $classObject to a string, or passing an $classObject where string is expected. Using proper IDE maybe can give you better insight into your error.
Object of class stdClass could not be converted to string
Hey all - I've been looking into this problem for a while now and don't know what to think of it.
I'm calling a SOAP API server with this command: $arr_agenda = $this->connection->GetAgendaItems($GetAgenda);
GetAgenda is an object with this content
$GetAgenda = new GetAgenda(); $GetAgenda->UserName = $this->UserName; $GetAgenda->Password = $this->Password; $GetAgenda->AgendaFilter = $AgendaFilter;
AgendaFilter is a second object with this content:
App\Ets\Classes\AgendaFilter { +LastModifiedTimeGreaterOrEqualThan: null +StartGreaterOrEqualThan: "2019-10-28 00:00:00" +EndSmallerOrEqualThan: null +EmployeesId: null }
When I run the code I get an error
ErrorException Object of class stdClass could not be converted to string https://gmt.test/update/syncAgenda
Illuminate\Foundation\Bootstrap\HandleExceptions::handleError vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php:184
When I leave out the AgendaFilter everything runs fine.
The GetAgendaItems method expects this:
GetAgendaItems (string UserName, string Password, AgendaFilter AgendaFilter)
AgendaFilter is this: LastModifiedTimeGreaterOrEqualThan Nullable - DateTime StartGreaterOrEqualThan - Nullable DateTime EndSmallerOrEqualThan - Nullable DateTime EmployeesId - List
Any guidance on where to look would be very much appreciated.
Please or to participate in this conversation.