我在尝试将此网址加载到我的代码中时遇到了严重问题。当我在浏览器中访问实际页面时,它可以正常加载,但是当我解析它基本上给出404时,我已经尝试使用soap客户端和curl认为好吧也许我做错了。
这是我的代码,你可以看到它的基础知识。
$customerId = 'xxxx';
$authenticationId = 'xxxx';
$url = 'https://test.api.800loanmart.com/LoanmartService.svc?wsdl';
$config = array('trace' => 1, 'exceptions' => 0);
$service = new SoapClient($url,$config);
$result = $service->GetTermsAndConditions($customerId, $authenticationId);
var_dump($service);
这就是它向我投掷的东西......
Warning: SoapClient::SoapClient() [soapclient.soapclient]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\loanmart\index.php on line 6
Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://test.api.800loanmart.com/LoanmartService.svc?wsdl" in C:\xampp\htdocs\loanmart\index.php on line 6
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://test.api.800loanmart.com/LoanmartService.svc?wsdl' : failed to load external entity "https://test.api.800loanmart.com/LoanmartService.svc?wsdl" in C:\xampp\htdocs\loanmart\index.php on line 6
我已经检查过我是否有openssl并且在我的php.ini文件中打开了,我只是非常难过该怎么办。
答案 0 :(得分:1)
即使您确实检查过,这只是一个openssl配置问题(在SoapClient中使用,但仍然存在)
尝试file_get_contents($wsdl_url);
另外,检查你当前加载的php.ini&支持的流(php.ini可能不同于CLI到Web SAPI)
php -r "phpinfo();" > file.txt
我是:
已注册的PHP Streams => php,文件,glob,数据,http,ftp,zip,compress.zlib,compress.bzip2,https,ftps,phar 答案 1 :(得分:1)
让我头疼的简单问题!在apache服务器目录中打开php.ini文件,取消注释(启用)行extension=php_openssl.dll
。
这解决了我的问题。
答案 2 :(得分:0)
在php.ini中使用active extension = php_openssl.dll。重启服务器。