【发布时间】:2014-03-09 00:33:07
【问题描述】:
我在使用 SOAP 运行方法时遇到问题。我正在使用 Apache 和 PHP。
这是 PHP 代码:
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA')
);
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);
$client = new SoapClient('https://host?wsdl', array (
'stream_context' => stream_context_create($opts),
"trace" => 1,
"exceptions" => 0,
"connection_timeout"=>2000));
var_dump($client->__getFunctions());
$params = array ("key" => "value");
$result = $client->availabeFunction($params);
var_dump($result);
__getFunctions() 它返回给我所有可用的功能。
然后当我尝试使用参数调用可用函数时。
它返回一个错误消息:
public 'faultstring' => string 'Could not connect to host' (length=25)
public 'faultcode' => string 'HTTP' (length=4)
所以我认为由于某些原因是通过 HTTP 连接,而不是通过 HTTPS。
我查看了网络,在某些情况下,他们使用带有 .pem 文件的 local_cert 值。
它必须拥有它吗?还是我错过了其他东西?
【问题讨论】: