我的网络服务有问题。 Web服务有两个不同的版本:
我已经弄清楚了如何使用测试环境来再次使用Web服务。在请求网络服务时,会发送一些登录凭据以及一个CA和一个证书:
$cert = $pdir_resources . 'Kommun_A.pem'; //A certificate
$sslOptions = array(
'local_cert' => $cert,
'verify_peer' => true,
'cafile' => $ca,
'peer_name' => 'kt-extportwise.statenspersonadressregister.se'
);
$streamcontext = stream_context_create(
array('ssl' => $sslOptions)
);
$options = array(
'stream_context' => $streamcontext
);
$wsdl = 'https://kt-ext-
ws.statenspersonadressregister.se/spar-webservice/SPARPersonsokningService/20160213/SPARPersonsokning.wsdl';
//Create actual soap client
$soap = new SoapClient($wsdl, $options);
return $soap;
我从Skatteverket获得了上面的代码(约等于IRS)
当我在生产环境中尝试相同的操作时:
$cert = $pdir_resources . 'Kommun_realcompany.pem'; //A certificate
$sslOptions = array(
'local_cert' => $cert, //Should this be included?Ä
'verify_peer' => true,
'cafile' => $ca, //Should this be included?
'peer_name' => 'ext-ws.statenspersonadressregister.se'
);
$streamcontext = stream_context_create(
array('ssl' => $sslOptions)
);
$options = array(
'stream_context' => $streamcontext
);
$wsdl = 'https://ext-ws.statenspersonadressregister.se/spar-webservice/SPARPersonsokningService/20160213/SPARPersonsokning.wsdl';
//Create actual soap client
$soap = new SoapClient($wsdl, $options);
return $soap;
但是当我使用测试环境时,它可以正常工作,但是在生产环境中,我会收到此错误:
Fel i SOAP: SoapFault Object
(
[message:protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ext-ws.statenspersonadressregister.se/spar-webservice/SPARPersonsokningService/20160213/SPARPersonsokning.wsdl' : failed to load external entity "https://ext-ws.statenspersonadressregister.se/spar-webservice/SPARPersonsokningService/20160213/SPARPersonsokning.wsdl"
我已经尝试寻求他们的客户支持,但是我确实没有提供任何帮助。这就是为什么我要在这里伸出援手。我不确定应该发送什么。是一个证书和登录凭证吗?