SoapFault:SOAP-ERROR:解析 WSDL:无法从中加载

问题描述 投票:0回答:0

我在下面有这些错误

SoapFault:SOAP-ERROR:解析 WSDL:无法从“https://xxxxxx.xxxx.xxx/xxxx/XxxxServices?wsdl=XXX.wsdl”加载:无法加载外部实体“https://xxxxxx.xxxx .xxx/xxxx/XxxxServices?wsdl=XXX.wsdl" 在 SoapClient->__construct() (/opt/bitnami/apache/htdocs/xxxx/web/modules/custom/xxxx/src/XXX/XXX.php 的第 30 行).

警告:SoapClient::__construct():I/O 警告:无法加载外部实体“'https://xxxxxx.xxxx.xxx/xxxx/XxxxServices?wsdl=XXX.wsdl':无法加载外部实体”https SoapClient->__construct() 中的 ://xxxxxx.xxxx.xxx/xxxx/XxxxServices?wsdl=XXX.wsdl(/opt/bitnami/apache/htdocs/xxxx/web/modules/custom/xxxx/src 的第 30 行/XXX/XXX.php).

警告:SoapClient::__construct(https://xxxxxx.xxxx.xxx/xxxx/XxxxServices?wsdl=XXX.wsdl):无法打开流:连接在 Drupal\xxx\xxx\XxxxServices->__construct 中超时() (opt/bitnami/apache/htdocs/xxxx/web/modules/custom/xxxx/src/XXX/XXX.php的第30行)

我的代码是这样的

public function __construct(array $options, $qa = true) {
  foreach (['login', 'password'] as $item) {
    if (empty($options[$item])) {
      throw new \InvalidArgumentException("$item is required for " . __CLASS__);
    }
  }

  $wsdl = $qa ? __DIR__ . '/../../wsdl/qa.wsdl' : __DIR__ . '/../../wsdl/prod.wsdl';

  parent::__construct($wsdl, $options + [
    'authentication' => SOAP_AUTHENTICATION_BASIC,
    'soap_version' => SOAP_1_1,
    'trace' => 1,
    'classmap' => static::$classMap,
    'cache_wsdl' => WSDL_CACHE_NONE,
  ]);
}
php web-services soap wsdl drupal-9
© www.soinside.com 2019 - 2024. All rights reserved.