php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55348 SoapServer (typemap related) "Error calling from_xml callback"
Submitted: 2011-08-02 15:14 UTC Modified: 2011-08-23 12:26 UTC
Votes:7
Avg. Score:4.7 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: sprotte at visionconnect dot de Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.7RC4 OS: openSUSE 11.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sprotte at visionconnect dot de
New email:
PHP Version: OS:

 

 [2011-08-02 15:14 UTC] sprotte at visionconnect dot de
Description:
------------
Throwing a SoapFault exception inside the from_xml callback function (when using the "typemap" feature with SoapServer) does not work as expected in some cases.

I have created a small client/server application with one working example (type "date") and one not working example (type "myType").

In case of the "date" type the SoapFault exception is transformed into a matching SOAP-Response. The original message is available on the client side.
In case of the "myType" type the thrown SoapFault exception is completely ignored and the SOAP-Response contains another error message.


Test script:
---------------
http://www.visionconnect.de/php_bugreports/soapserver_to_xml.tar.gz

Expected result:
----------------
Faultcode: 0001
Faultstring: Invalid date: 2011-15-15
Faultcode: 0002
Faultstring: Invalid type: foobar


Actual result:
--------------
Faultcode: 0001
Faultstring: Invalid date: 2011-15-15
Faultcode: SOAP-ENV:Server
Faultstring: SOAP-ERROR: Encoding: Error calling from_xml callback


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-22 19:48 UTC] chris at cmbuckley dot co dot uk
Description:
------------
Reduced to smaller test script.

Test script:
------------

http://starsquare.co.uk/code/php/bugs/55348.phps

Expected result:
----------------

...
<SOAP-ENV:Fault>
  <faultcode>SOAP-ENV:Server</faultcode>
  <faultstring>Conversion Fault</faultstring>
</SOAP-ENV:Fault>
...

Actual result:
--------------

Fatal error: SOAP-ERROR: Encoding: Error calling from_xml callback
 [2011-08-23 11:19 UTC] chris at cmbuckley dot co dot uk
Additional: Fatal only happens in conjunction with Xdebug (see https://bugs.php.net/bug.php?id=50547).
 [2011-08-23 12:26 UTC] derick@php.net
There is an incompatibility with Xdebug and the SOAP extension, due to the way that the SOAP extension also overloads php_error_cb. In order to properly fix this, the error_cb overloading needs to be changed. I don't however know, exactly how.
See also: 
http://bugs.xdebug.org/view.php?id=609
http://bugs.xdebug.org/view.php?id=705
 [2012-02-12 18:20 UTC] chris at cmbuckley dot co dot uk
Regardless of the Xdebug comment, the error is still present without Xdebug; if the from_xml callback generates an error more than once during server handling, the error message "Error calling from_xml callback" is shown instead of the actual fault.
 [2013-05-02 15:07 UTC] sprotte at visionconnect dot de
Any news to this? Like Chris said, this is also happening when xdebug is NOT installed. The problem still exists in PHP 5.3.24.
 [2023-01-11 15:49 UTC] chris at cmbuckley dot co dot uk
This was fixed in PHP 8.2.0beta1. There is a fix in the SOAP extension in 8.2, but as this is backported to 8.x, the issue must have been in Core.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 22:03:41 2023 UTC