php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35677 Using PDO with SOAP (Webservices) causes errors.
Submitted: 2005-12-15 10:33 UTC Modified: 2005-12-21 09:56 UTC
From: prefab5 at hotmail dot com Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5CVS-2005-12-15 (snap) OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: prefab5 at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-12-15 10:33 UTC] prefab5 at hotmail dot com
Description:
------------
When connecting to a SoapServer that also includes PDO to create a database connection, the SoapServer stops sending SOAP-ENV resulting in a "Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in..."

Using mysqli to connect to a database within the SoapServer (you actually call PDO/mysqli from within the class that the SoapServer uses)  works fine and directly calling the class itself also causes no problems.

PHP doesn't crash, but sometimes Apache (2.0.55) does.

Reproduce code:
---------------
http://www.mindstix.com/persistenceTestServer.zip

Expected result:
----------------
Count: 1
Count: 2
Count: 3

Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\test\webservices\persistenceTestClient.php:6 Stack trace: #0 [internal function]: SoapClient->__call('count', Array) #1 C:\test\webservices\persistenceTestClient.php(6): SoapClient->count() #2 {main} thrown in C:\test\webservices\persistenceTestClient.php on line 6



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-17 15:13 UTC] prefab5 at hotmail dot com
The file with the example scripts in it can now be found somewhere else:

http://www.sidemedia.nl/mindstix/persistenceTestServer.zip
 [2005-12-21 09:56 UTC] dmitry@php.net
You tries to make object of "persistenceTestServer" - persistent, but the object contains PDO object that cannot be serialized/unserialized. This is the reason of error on SOAP server side. The errors occurs during serialzation of sessiondata (on request shutdown), and this kind of error cannot be catched by ext/soap to send SOAP Fault.

I recommend move PDO object from the "persistenceTestServer" class or add __sleep() and __wakeup() magic methods to handle it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC