【发布时间】:2016-08-29 13:18:15
【问题描述】:
我需要使用受密码保护的证书访问 SOAP 服务。我是 PHP 新手(在 CodeIgniter 2 中使用 PHP 5.4)并且尝试了一些对我不起作用的选项。
我有以下常量:
const WSDL = 'https://sedeapl.dgt.gob.es:8080/WS_IEST_COMP/descargaArchivoMicrodatosService?wsdl';
const XMLNS = 'https://sedeapl.dgt.gob.es:8080/WS_IEST_COMP/descargaArchivoMicrodatosService';
const LOCAL_CERT_PASSWD = 'HERE I HAVE THE PASS OF THE CERT';
const LOCAL_CERT = './certificados/Certificados.p12';
private $client;
我已经尝试了这些选项:
选项 A
$this->client = new SoapClient(self::WSDL, array(
"trace" => 1,
"exceptions" => true,
"local_cert" => self::LOCAL_CERT,
"uri" => "urn:xmethods-delayed-quotes",
"style" => SOAP_RPC,
"use" => SOAP_ENCODED,
"soap_version" => SOAP_1_2 ,
"location" => self::XMLNS
)
);
选项 B
$this->$client = new SoapClient(self::WSDL, array('local_cert' => self::LOCAL_CERT));
我不知道如何添加密码。这些解决方案是我在 StackOverflow 上找到的。在这两个例子中,我都得到了同样的错误:
SoapClient::SoapClient(): 找不到包装器“https” - 你有吗 配置PHP时忘记开启?
我已取消注释 php.ini 中的“extension=php_openssl.dll”
我已经尝试过这些证书路线:
const LOCAL_CERT = 'certificados/Certificados.p12';
const LOCAL_CERT = 'Certificados.p12';
const LOCAL_CERT = './certificados/Certificados.p12';
有没有人知道我能做什么。非常感谢!
【问题讨论】:
标签: php ssl soap wsdl codeigniter-2