[英]SOAP: Invalid HTTPS client certificate path
When I run the below-given code, the error ERROR: Invalid HTTPS client certificate path
is generated. 当我运行下面给出的代码时,错误
ERROR: Invalid HTTPS client certificate path
生成。 I checked that the path to certificate.pem and test.wsdl is correct. 我检查了certificate.pem和test.wsdl的路径是否正确。 What might be the reason of such error?
这种错误的原因可能是什么?
$wsdl = 'http://localhost:10088/test/test.wsdl';
$options = array(
'local_cert' => 'http://localhost:10088/test/certificate.pem',
'soap_version' => SOAP_1_1
);
try {
$client = new Zend_Soap_Client($wsdl, $options);
$result = $client->getLastResponse();
print_r($result);
} catch (SoapFault $s) {
die('ERROR: [' . $s->faultcode . '] ' . $s->faultstring);
} catch (Exception $e) {
die('ERROR: ' . $e->getMessage());
}
The value for the option local_cert
must be a file path instead of an URL. 该选项的值
local_cert
必须是文件路径,而不是一个URL。 Change the code to this for $options
: 将代码更改为
$options
:
$options = array(
'local_cert' => '/path_where_cert_is_stored/certificate.pem',
'soap_version' => SOAP_1_1
);
Since the documentation for Zend_Soap_Client isn't complete, you can look at PHP: SOAP - Manual for more information, because this what Zend_Soap_Client
uses under the hood. 由于Zend_Soap_Client的文档还不完善,因此您可以查看PHP:
Zend_Soap_Client
手册以获取更多信息,因为Zend_Soap_Client
可以在Zend_Soap_Client
使用它。 In my opinion the possible arguments are better described at PHP: SoapClient::SoapClient - Manual (especially look at the example). 在我看来,可能的参数在PHP:SoapClient :: SoapClient-手册 (尤其是示例)中有更好的描述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.