SOAP-加载本地WSDL文件

时间:2018-08-17 10:45:24

标签: php xml soap wsdl

如何将本地WSDL文件加载到SoapClient中?

$wsdl = __DIR__.'/wsdl.wsdl';
$this->client = new SoapClient($wsdl);

$xsd = __DIR__.'/wsdl/xsd/xmldsig-core-schema.xsd';
  

PHP致命错误:SOAP错误:解析WSDL:找不到任何可用的   WSDL中的绑定服务。

从WSDL文件到XSD文件的相对路径:./xsd/xmldsig-core-schema.xsd

WSDL

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >
    <wsdl:types>
</wsdl:definitions>

1 个答案:

答案 0 :(得分:6)

在您的WSDL文件中,

<soap:binding style="document" transport="https://schemas.xmlsoap.org/soap/https"/>

应该是

<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>