SOAP - 加载本地 WSDL 文件
SOAP - load local WSDL file
如何将本地 WSDL 文件加载到 SoapClient
?
$wsdl = __DIR__.'/wsdl.wsdl';
$this->client = new SoapClient($wsdl);
$xsd = __DIR__.'/wsdl/xsd/xmldsig-core-schema.xsd';
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Could not find any usable
binding services in 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>
在您的 WSDL 文件中,
<soap:binding style="document" transport="https://schemas.xmlsoap.org/soap/https"/>
应该是
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
如何将本地 WSDL 文件加载到 SoapClient
?
$wsdl = __DIR__.'/wsdl.wsdl';
$this->client = new SoapClient($wsdl);
$xsd = __DIR__.'/wsdl/xsd/xmldsig-core-schema.xsd';
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in 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>
在您的 WSDL 文件中,
<soap:binding style="document" transport="https://schemas.xmlsoap.org/soap/https"/>
应该是
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>