已修改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
<port name="soapPort" binding="tns:soapBinding"><soap:address location="http://test.soaptest.com/soap/Service.php" />
http://test.soaptest.com/Service.php?wsdl
如何能访问达到?本来是对的,被你改错了
$soap = new SoapClient('http://test.soaptest.com/soap/Service.php?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 规范的