如何在PHP中通过soap连接到主机?
我正试图在工作中的系统上实现益百利银行账户检查功能 我正在尝试使用php和Soap来实现这一点 这是我第一次使用Soap,所以我不能完全确定我是否正确 这是我的密码:如何在PHP中通过soap连接到主机?,php,soap,Php,Soap,我正试图在工作中的系统上实现益百利银行账户检查功能 我正在尝试使用php和Soap来实现这一点 这是我第一次使用Soap,所以我不能完全确定我是否正确 这是我的密码: <?php $options = array( 'local_cert'=>'certificate.p12', 'passphrase'=>'mypass', 'location'=>"https://secure.authenticator.u
<?php
$options = array(
'local_cert'=>'certificate.p12',
'passphrase'=>'mypass',
'location'=>"https://secure.authenticator.uat.uk.experian.com/WASPAuthenticator/Service.asmx",
'uri'=>'http://www.uk.experian.com/WASP/',
);
$authenticationBlock = "<WASPAuthenticationRequest>";
$authenticationBlock .= "<ApplicationName>YFR Admin</ApplicationName>";
$authenticationBlock .= "<AuthenticationLevel>CertificateAuthentication</AuthenticationLevel>";
$authenticationBlock .= "<AuthenticationParameters/>";
$authenticationBlock .= "</WASPAuthenticationRequest>";
try {
$client = new SoapClient(null, $options);
$result = $client->STS($authenticationBlock); // experian function - possibly the problem line
} catch (soapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
var_dump($result);
?>
我得到的错误是:
致命错误:SOAP错误:(错误代码:HTTP,错误字符串:无法连接到主机)在/myfile/的第21行
我觉得我在正确的地方使用了正确的细节,但我想我肯定错过了一些明显的东西,或者只是做错了整件事:)
有什么建议吗?你的
'location'=>“https://secure.authenticator.uat.uk.experian.com/WASPAuthenticator/Service.asmx“,
无法访问。你确定这个值吗?这就是SoapClient告诉您的。您可以使用SOAPUI或类似工具进行连接吗?不,我甚至不能使用SOAPUI