[php-src] Issue #13133: SOAP-ERROR: Parsing WSDL: Couldn't load from...
| From: | claudiobat | Date: | Fri, 12 Jan 2024 19:09:03 +0000 |
| Subject: | [php-src] Issue #13133: SOAP-ERROR: Parsing WSDL: Couldn't load from... | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246252@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13133
Author: claudiobat
### Description
The following code:
```php
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$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' => WSDL_CACHE_NONE,
'trace' => true,
'local_cert' => $local_cert,
'passphrase' => $passphrase,
'stream_context' => stream_context_create( $context_options ),
'soap_version' => SOAP_1_1,
);
try {
$soap_client = new SoapClient( $wsdl, $soap_client_options );
echo "\n Metodi disponibili:\n" . var_export( $soap_client->__getFunctions(), true );
} catch ( Exception $e ) {
var_dump(libxml_get_last_error());
var_dump($soap_client);
echo "@@@ ERRORE CLIENT:\n" . $e->getMessage();
exit;
}
```
Resulted in this output:
```
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 "<public_wsdl>"
"
public string $file =>
string(0) ""
public int $line =>
int(0)
}
C:\TestApiSoapWithPhp\testCaricaVersamento.php:79:
NULL
@@@ ERRORE CLIENT:
SOAP-ERROR: Parsing WSDL: Couldn't load from '<public_wsdl>' : failed to load
external entity "<public_wsdl>"
Process finished with exit code 0
```
But I expected this output instead:
```
The list of the methods provided by the WSDL.
```
If I remove the line:
'local_cert' => $local_cert,
it works.
The attachments are the output of the commands "php -i" and "php -m"
I'm using a Docker container built with the standard image: FROM php:8.2.14-apache
[php-m.txt](https://github.com/php/php-src/files/13922990/php-m.txt)
### PHP Version
PHP 8.2.14 (cli)
### Operating System
Docker container php:8.2.14-apache