【问题标题】:SoapClient: Unable to find the wrapper "https"SoapClient:找不到包装“https”
【发布时间】:2012-09-16 07:51:49
【问题描述】:

我在尝试将此 url 加载到我的代码中时遇到了严重的问题。当我转到浏览器中的实际页面时,它加载得很好,但是当我解析它时,它基本上给出了 404,我已经使用肥皂客户端尝试过这个,并且 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 文件中打开了,我只是不知道该怎么做。

【问题讨论】:

    标签: php soap


    【解决方案1】:

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

    这解决了我的问题。

    【讨论】:

      【解决方案2】:

      即使您进行了检查,这也只是一个 openssl 配置问题(在 SoapClient 中使用,但仍然如此)

      尝试file_get_contents($wsdl_url);

      另外,检查您当前加载的 php.ini 和支持的流(php.ini 可能与 CLI 到 Web SAPI 不同)

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

      我的: 已注册的 PHP 流 => php、文件、glob、数据、http、ftp、zip、compress.zlib、compress.bzip2、https、ftps、phar
      注册流套接字传输 => tcp、udp、ssl、sslv3、sslv2、tls (您的代码示例可以在我的计算机上运行:p)

      【讨论】:

        【解决方案3】:

        在 php.ini 中创建活动扩展=php_openssl.dll。重启服务器。

        【讨论】:

          猜你喜欢
          • 2020-12-05
          • 2015-05-25
          • 2013-05-19
          • 1970-01-01
          • 1970-01-01
          • 2015-07-25
          • 1970-01-01
          • 2013-09-09
          • 2012-07-08
          相关资源
          最近更新 更多