doushi7805 2016-08-10 00:45
浏览 170

php SOAP xml客户端不工作:致命错误:未捕获的SoapFault异常:[WSDL] SOAP-ERROR:解析WSDL:无法加载

I'm trying to get the currency from the National Bank. The only way they support is with SOAP.

But I can never get it to work...

Firstly I tried this:

$soapclient = new SoapClient('http://www.nbrm.gov.mk/klservice/kurs.asmx');


$params = array('StartDate' => '10.08.2016', 'EndDate' => '10.08.2016');
$response = $soapclient->GetExchangeRate($params);

var_dump($response);

Also tried this:

$url = 'http://www.nbrm.gov.mk/klservice/kurs.asmx';
$client = new SoapClient($url);

$xmlr = new SimpleXMLElement("<GetExchangeRate></GetExchangeRate>");
$xmlr->addChild('StartDate', '10.08.2016');
$xmlr->addChild('EndDate', '10.08.2016');


$params = new stdClass();
$params->xml = $xmlr->asXML();

$result = $client->CustomerSearchS($params);

These would be the operators: http://www.nbrm.mk/klservice/kurs.asmx?op=GetExchangeRate

POST /klservice/kurs.asmx HTTP/1.1
Host: www.nbrm.mk
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.nbrm.mk/klservice/GetExchangeRate"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetExchangeRate xmlns="http://www.nbrm.mk/klservice/">
      <StartDate>string</StartDate>
      <EndDate>string</EndDate>
    </GetExchangeRate>
  </soap:Body>
</soap:Envelope>

However all I get all the time is the following error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.nbrm.gov.mk/klservice/kurs.asmx' : failed to load external entity "http://www.nbrm.gov.mk/klservice/kurs.asmx" in


I'd like to point out that when viewing my php configuration everything for SOAP to function is enabled.

Am I doing something wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘