2016-12-12 72 views
1

我想在我的PHP代碼中進行SOAP調用。代碼位於file1.php中,而SOAP位於WSDL文件soap.xml中。新SoapClient的()是在管線150如何修復OpenCart PHP代碼中的SOAP調用錯誤?

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> 

如何解決問題?

+0

您使用的是哪個版本的PHP? –

+0

我們在SOAP 1.1上使用PHP 5.6.26 –

+1

也許這可以幫助你http://stackoverflow.com/questions/25142227/unable-to-connect-to-wsdl –

回答

0

我檢查了Jean-maxime Bouloc建議的鏈接。

$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)); 

我想給信貸讓 - 馬克西姆Bouloc幫了我:我如下調整了新SoapClient的()調用。