Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 康涅狄格网络服务_Php_Web Services_Soap_Wsdl - Fatal编程技术网

Php 康涅狄格网络服务

Php 康涅狄格网络服务,php,web-services,soap,wsdl,Php,Web Services,Soap,Wsdl,我在连接到web服务时遇到问题,下面是我的代码: $path = __DIR__; $wsdl = "https://wisetest.nobisassicurazioni.it/wisewebserviceptf/service.asmx?WSDL"; $urlC = $path."/wise-europeanbroker.vbnl6w.p12"; $soap_args = array( "login" => "europeanbrokers", "password

我在连接到web服务时遇到问题,下面是我的代码:

$path = __DIR__;
$wsdl = "https://wisetest.nobisassicurazioni.it/wisewebserviceptf/service.asmx?WSDL";
$urlC = $path."/wise-europeanbroker.vbnl6w.p12";

$soap_args = array(
     "login" => "europeanbrokers",
     "password" => "xxxxxx",
     "local_cert" => $urlC,
     'user_agent' => 'PHPSoapClient',
     "user_agent" => "PHP/SOAP",
     "accept" => "application/xml",
     "exceptions"=>true,
     "trace" => true,
     "http" => array('protocol_version' => '1.0'));
try {
     $context = stream_context_create($soap_args);
     $client = new SoapClient($wsdl,array('stream_context' => $context));
     echo "Connection ok\n";

} catch (SoapFault $e) {
     var_dump($e.message);

}
我认为上面的代码是可以的,但我总是得到以下错误:

string(428) "SoapFault exception:
[WSDL] SOAP-ERROR: Parsing WSDL:
Couldn't load from 'https://wisetest.nobisassicurazioni.it/wisewebserviceptf/service.asmx?WSDL' :
failed to load external entity "https://wisetest.nobisassicurazioni.it/wisewebserviceptf/service.asmx?WSDL"
in D:\siti\soap.test.local\SClient.php:40
Stack trace:
#0 D:\siti\soap.test.local\SClient.php(40):
SoapClient->SoapClient('https://wisetes...', Array)
#1 {main}message"

可能是什么问题?

您可以尝试浏览,查看该站点使用的证书无效。尝试将verify_peer=FALSE添加到SSL上下文选项中。

对我来说似乎是网络问题。你可以尝试访问你的机器,看看它是否加载?你的公司是否强制执行代理?检查浏览器或操作系统设置。您现在可能需要更改密码;-)这是证书:它是自签名的<代码>SoapClient默认情况下将拒绝它,除非您关闭证书验证。请参阅以了解如何禁用
SoapClient
的证书验证。谢谢大家,我尝试禁用证书验证。不幸的是,这还不够,我有一个新的错误:string(311)“SoapFault异常:[Client]SoapClient::SoapClient()[SoapClient.SoapClient]:在…local\SClient.php:31堆栈跟踪中的无效参数:#0…local\SClient.php(31):SoapClient->SoapClient('…',资源id#2)#1{main}消息”很抱歉,这是我第一次使用Web服务,Web服务的所有者没有帮助我。