2012-09-24 39 views
0

我遇到了严重的麻烦,试图让这个URL加载在我的代码中。当我去浏览器中的实际页面时,它加载得很好,但是当我解析它时,它基本上给出了404,我尝试过使用soap客户端和curl思考好,也许我做错了什么。SoapClient:无法找到包装“https”

这是我的代码,你可以看到它的基础知识。

$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文件,即时通讯开启刚相当难以做什么。

回答

1

即使你没有检查,这不过是一个OpenSSL的配置问题(在SoapClient的使用,但仍然)

尝试file_get_contents($wsdl_url);

另外,检查你当前加载的php.ini &支持流(的php.ini威力不同于CLI到卷筒纸SAPI)

php -r "phpinfo();" > file.txt 

矿: 注册PHP流=> PHP中,文件,水珠,数据,HTTP,FTP,拉链,compress.zlib,compress.bzip2,HTTPS ,FTPS,药业
注册流式套接字的Transport => TCP,UDP,SSL,SSLV3,SSLV2,TLS (你的代码示例工程在我的电脑上:P)

1

才让我头疼简单的问题!在您的apache服务器目录中打开您的php.ini文件并取消注释(启用)extension=php_openssl.dll行。

这解决了我的问题。

0

在php.ini中激活扩展名= php_openssl.dll。重新启动服务器。