我写了一个在 http 中调用 wsdl 的 php 库。
现在我想通过 https/ssl 协议(protocol)做同样的事情。
所以我更改了 wsdl 路径但还不够。
这里是代码:
<?php
$options = array(
'trace' => 1,
'exceptions' => 0,
'login' => $login,
'password' => $password
);
$wsdl= "https://toto.com/tata/ws/tutu?wsdl";
$service = new SoapClient($wsdl,$options);
?>
在服务器中,我正确地收到了命中,但通过的是 http,而不是 https:
供您引用,我已启用 openssl:
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
OpenSSL Header Version OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
你对此有解释吗?
谢谢。
最佳答案
WSDL 文件确实包含用于服务调用的 URL。这也更改为HTTPS吗?如果没有,您将只能看到使用 HTTPS 的 WSDL 请求(PHP 有一个缓存,所以如果不禁用它不会每次都发生)。
关于php - 想要使用 PHP soap 客户端连接到 https 主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19677026/