本帖最后由 i_bruce 于 2014-06-24 10:16:24 编辑

解决方案 »

  1.   

    把 wsdl 文件的 34行改为
    <port name="soapPort" binding="tns:soapBinding"><soap:address location="http://test.soaptest.com/soap/Service.php" />
      

  2.   

    已修改Warning: SoapClient::SoapClient(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /data/app/www/soaptest/client.php on line 3 Call Stack: 0.0001 323932 1. {main}() /data/app/www/soaptest/client.php:0 0.0002 324552 2. SoapClient->SoapClient() /data/app/www/soaptest/client.php:3 Warning: SoapClient::SoapClient(http://test.soaptest.com:80/Service.php?wsdl): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /data/app/www/soaptest/client.php on line 3 Call Stack: 0.0001 323932 1. {main}() /data/app/www/soaptest/client.php:0 0.0002 324552 2. SoapClient->SoapClient() /data/app/www/soaptest/client.php:3 Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "http://test.soaptest.com:80/Service.php?wsdl" in /data/app/www/soaptest/client.php on line 3 Call Stack: 0.0001 323932 1. {main}() /data/app/www/soaptest/client.php:0 0.0002 324552 2. SoapClient->SoapClient() /data/app/www/soaptest/client.php:3 Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://test.soaptest.com:80/Service.php?wsdl' : failed to load external entity "http://test.soaptest.com:80/Service.php?wsdl" in /data/app/www/soaptest/client.php on line 3 Call Stack: 0.0001 323932 1. {main}() /data/app/www/soaptest/client.php:0 0.0002 324552 2. SoapClient->SoapClient() /data/app/www/soaptest/client.php:3 
      

  3.   

    你的 Service.php 分明是在 soap 目录下,你却用
    http://test.soaptest.com/Service.php?wsdl
    如何能访问达到?本来是对的,被你改错了
    $soap = new SoapClient('http://test.soaptest.com/soap/Service.php?wsdl');
      

  4.   

    生成wsdl的没有soap目录? 
      

  5.   

    其实那篇介绍 SoapDiscovery 类的文章中,已经对如何发布说的很清楚了
      

  6.   

    生成的 WSDL 放在哪都无所谓,只要
    $server = new SoapServer('Service.wsdl', array('soap_version' => SOAP_1_2));
    这里路径是对的就行<port name="soapPort" binding="tns:soapBinding">
      <soap:address location="http://test.soaptest.com/soap/Service.php" />
    这是端口绑定,也就是说:使用 Service.wsdl 这个 WSDL 的访问,只能用 http://test.soaptest.com/soap/Service.php?wsdl 进入
    反过来说就是 http://test.soaptest.com/soap/Service.php?wsdl 这个服务是由 Service.wsdl 规范的