未捕获的SoapFault异常:无法加载外部

时间:2019-01-26 08:21:14

标签: soap-client iis-10 php-7.3

我是PHP + SOAP的新手,现在我需要使用它将一些数据传递给给定的url,不幸的是我收到了此错误

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/bms/server.php?wsdl' : failed to load external entity "http://localhost/bms/server.php?wsdl" in C:\inetpub\wwwroot\bms\client.php:12 Stack trace: #0 C:\inetpub\wwwroot\bms\client.php(12): SoapClient->SoapClient('http://10.1.65....') #1 {main} thrown in C:\inetpub\wwwroot\bms\client.php on line 12.

根据我在google上的研究,几乎所有这些解决方案都是启用 Soap,xml(已安装libxml库)和openssl ,并且所有这些均已打开,但我无法由于某些限制,无法访问/查看服务器代码。

我想念什么?

下面是我的客户代码

<?php

//client.php

$opt = array(
    'trace' => true
);
echo "1";
$client = new SOAPClient('http://localhost/bms/server.php?wsdl', $options);
echo "2";
//////////
$msg = "hello World";
$subj = "greating";
$recv  ="user@email.com";
$sentType = 2;
$sendDate = date("d/m/Y H:i:s");
$createdBy = "admin@email.com";
////////
$client->DoSendMessage(
    ['MsgContent' => $msg, 'Subject' => $subj,'Receiver' => $recv,
    'SendType' => $sentType,'SendDate' => $sendDate,
    'CreatedBy' => $createdBy]);
?>

工作环境: IIS 10, PHP 7.3

感谢您的时间。

1 个答案:

答案 0 :(得分:0)

似乎wsdl网址被阻止。尝试就此与供应商联系,或者从他们那里获取实际的wsdl文件。点击SOAP API的第一步是检查wsdl文件是否打开了外部XML structre