|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-29 12:13 UTC] mfp@php.net
[2008-04-25 12:40 UTC] cem@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
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->loadString('<ns1:process xm...') #1 [internal function]: SCA_Bindings_soap_Mapper->fromXML('<ns1:process xm...') #2 /usr/share/php5/SCA/Bindings/soap/ServiceRequestHandler.php(76): SoapServer->handle('<?xml version="...') #3 /usr/share/php5/SCA/SCA.php(209): SCA_Bindings_soap_ServiceRequestHandler->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