php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71984 SOAP-ERROR: Parsing WSDL: Couldn't load from...
Submitted: 2016-04-07 16:54 UTC Modified: 2023-11-04 01:22 UTC
Votes:64
Avg. Score:4.1 ± 1.1
Reproduced:53 of 55 (96.4%)
Same Version:11 (20.8%)
Same OS:16 (30.2%)
From: stef at rouschop dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 7.0.5 OS: Ubuntu 14.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
38 + 38 = ?
Subscribe to this entry?

 
 [2016-04-07 16:54 UTC] stef at rouschop dot com
Description:
------------
I've deployed a new server with php 7.0.5-2+deb.sury.org~trusty+1 (and included php7.0-SOAP) and I noticed the SOAP script was generating a SOAP-ERROR: 
SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://demo.l1nda.nl/api/webservice/?wsdl' : failed to load external entity "https://demo.l1nda.nl/api/webservice/?wsdl"
 in....

After some investigation I noticed that on other servers where 7.0.3-5+deb.sury.org~trusty+1 is installed there are no errors.

This is the small script I'm using for my tests on the servers to see if it works/fails:




Test script:
---------------
$client = new \SoapClient("https://demo.l1nda.nl/api/webservice/?wsdl", ["trace" => 1,"exceptions" => true,]);
var_dump($client->__getFunctions());

Expected result:
----------------
array:6 [
  0 => "sendResponse send(send $send)"
  1 => "get_changed_eventsResponse get_changed_events(get_changed_events $get_changed_events)"
  2 => "get_eventsResponse get_events(get_events $get_events)"
  3 => "sendResponse send(send $send)"
  4 => "get_changed_eventsResponse get_changed_events(get_changed_events $get_changed_events)"
  5 => "get_eventsResponse get_events(get_events $get_events)"
]

Actual result:
--------------
SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://demo.l1nda.nl/api/webservice/?wsdl' : failed to load external entity "https://demo.l1nda.nl/api/webservice/?wsdl"
 in....

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-13 07:37 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-04-13 07:37 UTC] ab@php.net
Thanks for the report. Is ext/openssl enabled on the corresponding host (consider "https://...."). I currently don't reproduce the error otherwise.

Thanks.
 [2016-04-13 07:45 UTC] stef at rouschop dot com
-Status: Feedback +Status: Open
 [2016-04-13 07:45 UTC] stef at rouschop dot com
Yes, openssl is enabled.
I asked the owner of the webservice to look into his server log. He cannot find an entry of my server trying to connect. When I do a cURL request to this server it will work correctly and is also recorded in the serverlog.

On our other server with 7.0.3-5+deb.sury.org~trusty+1. The SOAP runs like it should.

Are you able to reproduce this?
 [2018-01-11 11:44 UTC] jitesh dot gondaliya at techcronus dot com
Hi i am getting SOAP-ERROR: Parsing WSDL: Couldn't load from 

Please help me for that
 [2018-10-10 08:03 UTC] jan dot zelenka at clickworks dot eu
I experience the same issue on PHP 5.6 on Windows.
What I want to add is that the WSDL provider offers both http and https protocols for linking with the WSDL definition. We've been using http happily all the time. It's https where things go wrong. Hope this helps.
 [2018-10-10 11:18 UTC] jan dot zelenka at clickworks dot eu
Sorry all, after some more digging it turned out to be my mistake: the extension php_openssl was not enabled.
 [2021-03-23 16:35 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-23 16:35 UTC] cmb@php.net
I cannot reproduce this with PHP-7.4.  Can anybody else reproduce
with any of the actively supported PHP versions[1] (and OpenSSL
enabled)?

[1] <https://www.php.net/supported-versions.php>
 [2021-03-24 21:07 UTC] anthony dot ferrara at sgkinc dot com
I am seeing this problem. PHP version 7.3.14. ext/openssl is enabled.
 [2021-04-04 04:22 UTC] php-bugs at lists dot php dot net
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.
 [2022-05-05 21:26 UTC] felipefermin at gmail dot com
This issue persists. PHP version 7.4.12. ext/openssl is enabled.
 [2022-05-06 08:46 UTC] cmb@php.net
-Status: No Feedback +Status: Open -Assigned To: cmb +Assigned To:
 [2022-05-06 08:46 UTC] cmb@php.net
Okay, re-opening then.
 [2023-02-15 15:28 UTC] ms dot sayyari at gmail dot com
I also have the same problem with PHP 7.4.13 on Ubuntu 20.04.
ext/openssl is enabled
 [2023-11-04 01:22 UTC] nielsdos@php.net
I can't reproduce this on 8.1+, but given the number of votes there is probably something wrong...
This could happen when some unrelated code calls libxml_disable_entity_loader(), so if anyone has this problem it might be worth checking that...
Otherwise, can anyone who can reproduce this try to compile PHP themselves and get a backtrace from the exception?
 [2024-01-12 14:02 UTC] ilclaudio at gmail dot com
Hi,
I have the same error:
"class LibXMLError#1 (6) {
  public int $level =>
  int(1)
  public int $code =>
  int(1549)
  public int $column =>
  int(0)
  public string $message =>
  string(137) "failed to load external entity "...anaddress/awsdl?wsdl"
"
  public string $file =>
  string(0) ""
  public int $line =>
  int(0)
}
C:\TestApiSoapWithPhp\testCaricaVersamento.php:79:
SOAP-ERROR: Parsing WSDL: Couldn't load from '...anaddress/awsdl?wsdl' : failed to load external entity ".../anaddress/awsdl?wsdl"

with this code: 
$context_options = array(
	'ssl' => array(
		'verify_peer'       => false,
		'verify_host'       => false,
		'verify_peer_name'  => false,
		'allow_self_signed' => true,
		'crypto_method'     => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
	),
);

$soap_client_options = array(
	'user_agent'         => $user_agent,
	'login'              => $username,
	'password'           => $password,
	'authentication'     => SOAP_AUTHENTICATION_BASIC,
	'exception'          => false,
	'keep_alive '        => false,
	'encoding'           => 'UTF-8',
	'compression'        => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
	'cache_wsdl'         => 0,
	'trace'              => 1,
	'local_cert'         => $local_cert,
	'passphrase'         => $passphrase,
	'stream_context'     => stream_context_create( $context_options ),
	'soap_version'       => SOAP_1_1,
);
$soap_client = new SoapClient( $wsdl, $soap_client_options );
echo "\n Metodi disponibili:\n" . var_export( $soap_client->__getFunctions(), true );

And it happens only when "local_cert" is specified.
I'm using PHP 8.2.13 on windows 11.
Without specifying local_cert I have the list of the methods.
However I ha to specify the file to call the methods.

The same code is working on a debian with php 7.4.
I can't understand which are the differcences between the two configurations.

Claudio
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 21:01:29 2024 UTC