欢迎各位兄弟 发布技术文章
这里的技术是共享的
Message = SoapFault exception: [Client] DTD are not supported by SOAP in D:\xampputf8\htdocs\mysoap\soap\soap_client-wsdl-ok.php:6 Stack trace: #0 D:\xampputf8\htdocs\mysoap\soap\soap_client-wsdl-ok.php(6): SoapClient->__soapCall('greet', Array) #1 {main}
1)很可能是 wsdl 文件里面 location 地址错了
<wsdl:service name='helloService'>
<wsdl:port binding='impl:helloServiceSoapBinding' name='helloService'>
<wsdlsoap:address location='http://localhost/mysoap/soap/soap_client-non-wsdl-ok.php' />
</wsdl:port>
</wsdl:service>
2) 客户端和服务端 php 代码里面 关于 wsdl路径是否错了
客户端端代码 必须为相对路径
soap_client-wsdl-ok.php 中
$client = new SoapClient('http://my.mysoap.com/soap/hello-ok.wsdl');
服务端代码 可以为相对路径
soap_server-wsdl-ok.php 中
$server = new SoapServer('hello-ok.wsdl');