第一次用nusoap,出错,查了很久了还是没解决问题,请教高手。
003.php如下:
<?php require_once('lib/nusoap.php'); function hello(){ return 'Hello World'; } $server = new soap_server(); $server->register('hello'); $server->service($HTTP_RAW_POST_DATA);
004.php如下:
<?php require_once('lib/nusoap.php'); $wsdl = 'http://www.127.0.0.1/eroom/003.php'; $client = new nusoap_client($wsdl); $res = $client->call('hello'); echo $res; if($client->getError()){ echo $client->getError(); }
浏览器访问:http://localhost/eroom/004.php ,出现如下信息:
HTTP Error: Couldn't open socket connection to server http://www.127.0.0.1/eroom/003.php prior to connect(). This is often a problem looking up the host name.
请问:是什么原因造成的?怎样解决?十分感谢
回复讨论(解决方案)
你确定网址准确?
http://www.127.0.0.1/eroom/003.php
??地址有??。
??是127.0.0.1吧
你确定网址准确?
http://www.127.0.0.1/eroom/003.php
??地址有??。
??是127.0.0.1吧
我的错!!!