php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57826 SCA does not show libxml2 parse errors
Submitted: 2007-09-06 10:02 UTC Modified: 2008-04-25 12:40 UTC
From: mattsch at gmail dot com Assigned: fulmar (profile)
Status: Closed Package: SCA_SDO (PECL)
PHP Version: 5.2.1 OS: Gentoo Linux
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mattsch at gmail dot com
New email:
PHP Version: OS:

 

 [2007-09-06 10:02 UTC] mattsch at gmail dot com
Description:
------------
I have noticed that there are multiple sections of SCA where it is covering up parse errors from libxml2.  I think the code needs to be refactored to display these parse errors because messages like "Unable to decode from XML" are impossible to debug.

Reproduce code:
---------------
        public function fromXML($xml)
        {
            SCA::$logger->log('Entering');
            SCA::$logger->log("xml = $xml");

                $doc = $this->xmldas->loadString($xml);
                $ret = $doc->getRootDataObject();
#This try/catch is covering up parse errors
            try
            {
#                $doc = $this->xmldas->loadString($xml);
#                $ret = $doc->getRootDataObject();
                return         $ret;
            }
            catch( Exception $e )
            {
                $problem = $e->getMessage();
                if ( $e instanceof SDO_Exception )
                $problem = "SDO_Exception in fromXML : " . $problem ;

                /**
                 * Depending on whether the function is being used on the client side
                 * or the server side either report the problem to the client, or
                 * record the problem in the error.log
                 */
                trigger_error($problem);

                /* When the 'TypeHandler is being used by the Soap Server          */
                if (strcmp($this->association, self::SERVER) === 0)
                SoapServer::fault("Client", "Unable to decode from XML");

            }/* End trap the problem                                               */


        }/* End fromXML function 

Expected result:
----------------
Fatal error: Uncaught SCA_RuntimeException: The remote service threw a soap fault. The text of the response was: <br /> <b>Fatal error</b>: Uncaught exception 'SDO_DAS_XML_ParserException' with message 'SDO_DAS_XML::loadString - Unable to parse the supplied xml string 3 parse error(s) occurred when parsing the string: 1. Parser found unknown element entityId 2. Parser found unknown element amount 3. Parser found unknown element referenceId ' in /usr/share/php5/SCA/Bindings/soap/Mapper.php:96 Stack trace: #0 /usr/share/php5/SCA/Bindings/soap/Mapper.php(96): SDO_DAS_XML-&gt;loadString('&lt;ns1:process xm...') #1 [internal function]: SCA_Bindings_soap_Mapper-&gt;fromXML('&lt;ns1:process xm...') #2 /usr/share/php5/SCA/Bindings/soap/ServiceRequestHandler.php(76): SoapServer-&gt;handle('&lt;?xml version=&quot;...') #3 /usr/share/php5/SCA/SCA.php(209): SCA_Bindings_soap_ServiceRequestHandler-&gt;handle('/home/www/servi...', Object(SCA_ServiceDescription)) #4 /usr/share/php5/SCA/SCA.php(545): SCA::initComponent('/home/www/servi in /usr/share/php5/SCA/Bindings/soap/Proxy.php on line 399

Actual result:
--------------
Fatal error: Uncaught SCA_RuntimeException: The remote service threw a soap fault. The text of the response was: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Unable to decode from XML</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> thrown in /usr/share/php5/SCA/Bindings/soap/Proxy.php on line 399

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-29 12:13 UTC] mfp@php.net
At first I thought we shouldn't do this as it would be giving away information from the server, but on reflection I realised it was only information about the data that had come from the client anyway. I have put a fix into FULMAR.
 [2008-04-25 12:40 UTC] cem@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/SCA_SDO

Matthew says this is in the 1.2.4 release
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 24 15:03:34 2022 UTC