r/PHPhelp • • Feb 03 '26

Solved SOAP Response Object Tree from XML String

In a project we have a SOAP Service with about 500 generated Classes that are described in a WSDL. We are using WsdlToPhp for generating the PHP services, enums and structs. Everything is working fine so far.

We are storing the SOAP response - the raw XML - in a database. From time to time we need the information from the SOAP response. Which brings me to my question:

Is it possible to get the PHP object tree instantiated by an XML string (from the database) and not from a SOAP service call?

P.S. And with possible I mean something that is not too hacky.

2 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/thmsbrss Feb 03 '26 edited Feb 03 '26

This is what we are doing, but with JSON, that was transformed from XML before.

And it is quite hacky, the good old PHP array thingy... And the SOAP answers are quite complex, too.

I was hoping for an answer that says: take this and you can use the object tree (since the classes are already there).