我有第三方本地wsdl,包含6个.wsdl文件和14个.xsd文件。
每个.wsdl文件都以字符串开头:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions ... xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" ...
当我创建像
这样的soapClient时$sc = new SoapClient($myLocalWsdlMainFile, [
'soap_version'=>SOAP_1_1,//SOAP_1_2 getting same result
'location' => $myLocation,
'uri' => $myUri,
"trace" => 1,
"exception" => 1,
]);
我马上收到错误
SOAP-ERROR:解析WSDL:未知所需的WSDL扩展&#39; http://www.w3.org/2006/05/addressing/wsdl&#39;
我做错了什么?为什么我会收到此错误?
答案 0 :(得分:0)
根据此线程:https://github.com/phpro/soap-client/issues/20 它是由于WSAW扩展而发生的,默认情况下,它不包含在SoapClient软件包中。要消除此错误,请在.wsdl文件中进行更改:
<wsaw:UsingAddressing wsdl:required="true"/>
收件人:
<wsaw:UsingAddressing wsdl:required="false"/>
更改必需的=“ false”对我来说没问题!