Bug #72136 [Fbk->NoF]: Instancing SoapClient causing SimpleXMLElement::asXML method doesn't work

From: Date: Sun, 26 Sep 2021 04:22:13 +0000
Subject: Bug #72136 [Fbk->NoF]: Instancing SoapClient causing SimpleXMLElement::asXML method doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236844@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72136&edit=1 ID: 72136 Updated by: php-bugs@lists.php.net Reported by: michal at lipek dot net Summary: Instancing SoapClient causing SimpleXMLElement::asXML method doesn't work -Status: Feedback +Status: No Feedback Type: Bug Package: SOAP related Operating System: Linux, Windows PHP Version: 7.0.6 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2021-09-13 16:00:44] cmb@php.net I cannot reproduce this with PHP-7.4 on Windows; I get: bool(true) array(1) { [0]=> object(LibXMLError)#3 (6) { ["level"]=> int(1) ["code"]=> int(1549) ["column"]=> int(0) ["message"]=> string(43) "failed to load external entity "fake/wsdl" " ["file"]=> string(0) "" ["line"]=> int(0) } } Can anybody reproduce this with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2021-02-12 17:59:28] gudang dot 673 at gmail dot cpm Almost five years and no fix yet? Seriously? ------------------------------------------------------------------------ [2017-03-31 12:14:07] kondratev dot v at gmail dot com Good afternoon. Faced the same problem. I get false in the save method of the DOMDocument class. try { $test = @new SoapClient($url, $options); } catch (SoapFault $e) { } //***** $dom = new DOMDocument('1.0', "UTF-8"); //... $result = $dom->save($fileName); $result === false //**** it works: if ($result === false) { file_put_contents($fileName, $dom->saveXML()); } ------------------------------------------------------------------------ [2016-05-02 07:04:41] michal at lipek dot net Description: ------------ Creating instance of \SoapClient with incorrect path to WSDL file causing incorrect work of SimpleXMLElement::asXML method, in completely different object. I ran script below in PHP: 5.5 (Debian), 5.6 (Windows) and 7.0.6 (Windows) and 7.0.5 (CentOS). I got errors only in PHP 7 on Windows and Linux. I've made one change in php.ini - I was activated php_soap extension. Test script: --------------- <?php libxml_use_internal_errors(true); try { $a = new \SoapClient('fake/wsdl'); } catch (\SoapFault $ex) { } $source = simplexml_load_string("<xml></xml>"); var_dump($source->asXML('example.xml')); // should be true var_dump(libxml_get_errors()); // should be one error, but there are 2 Expected result: ---------------- bool(true) array(1) { [0]=> object(LibXMLError)#3 (6) { ["level"]=> int(1) ["code"]=> int(1549) ["column"]=> int(0) ["message"]=> string(43) "failed to load external entity "fake/wsdl" " ["file"]=> string(0) "" ["line"]=> int(0) } } PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'fake/wsdl' : failed to load external entity "fake/wsdl" in C:\a.php on line 6 Actual result: -------------- bool(false) array(2) { [0]=> object(LibXMLError)#3 (6) { ["level"]=> int(1) ["code"]=> int(1549) ["column"]=> int(0) ["message"]=> string(43) "failed to load external entity "fake/wsdl" " ["file"]=> string(0) "" ["line"]=> int(0) } [1]=> object(LibXMLError)#4 (6) { ["level"]=> int(2) ["code"]=> int(1545) ["column"]=> int(0) ["message"]=> string(11) "flush error" ["file"]=> string(0) "" ["line"]=> int(0) } } PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'fake/wsdl' : failed to load external entity "fake/wsdl" in C:\a.php on line 6 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72136&edit=1

« previous php.bugs (#236844) next »