I am using web services (using SOAP and WSDL) for connecting to a database (PDO connection) and for running queries. I would like the PDO object to remain global throughout my application for executing queries. But on sending the PDO object after the database connection, the SOAP response I get is a stdClass object and not a PDO object. How do I get a PDO object as a soap response? Please help.
Share
You cannot get a soap object as a PDO object. SOAP is a protocol based on XML, and when PHP parses the XML it creates stdClass.
If you want to ‘convert’ stdClass to a PDO object, you have to write your own code.