如何修复 OpenCart PHP 代码中 SOAP 调用的错误?

How do I fix error on SOAP call in my OpenCart PHP code?

我正在尝试在我的 PHP 代码中进行 SOAP 调用。代码在 file1.php 中,而 SOAP 在 WSDL 文件中,soap.xml。新的 SoapClient() 在第 150 行

file1.php 是 OpenCart 2.3 中的控制器文件

$user = 'user';
$password = 'password';
$wsdl = 'soap.xml'

$client = new SoapClient($wsdl,array('login' => "$user", 'password' => "$password", 'encoding'=>'ISO-8859-1', 'trace'=>1, 'stream_context' => stream_context_create(array('https' => array('protocol_version' => 1.0) ) ), 'cache_wsdl'=>WSDL_CACHE_NONE));

这是我不断收到的错误:

SoapClient::SoapClient(): SSL operation failed with code 1. OpenSSL

Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in <b>file1.php</b> on line <b>150</b><b>Warning</b>: SoapClient::SoapClient(): Failed to enable crypto in <b>file1</b> on line <b>150</b><b>Warning</b>: SoapClient::SoapClient (https://soap.xml): failed to open stream: operation failed in <b>file1.php</b> on line <b>150</b><b>Warning</b>: SoapClient::SoapClient(): I/O warning : failed to load external entity &quot;https:soap.xml&quot; in <b>file1.php</b> on line <b>150</b>

我该如何解决这个问题?

我已经检查了 Jean-maxime Bouloc 建议的 link。我调整了新的 SoapClient() 调用如下:

$client = new SoapClient($wsdl,array('login' => "$user", 'password' => "$password", 'encoding'=>'ISO-8859-1', 'trace'=>1, 'stream_context' => stream_context_create(array('https' => array('protocol_version' => 1.0), 'ssl' => array('verify_peer' => false, 'verify_peer_name'=> false,) ) ), 'cache_wsdl'=>WSDL_CACHE_NONE));

感谢 Jean-maxime Bouloc 对我的帮助。