搞了半天就是报错误,各种百度,谷歌才把问题一一解决。

我把我的例子写下来

CI中只写C就行了不用写V那成,如果有调用数据的话在写M那成。

服务器端:

public function index(){

$routes =  "application/libraries/lib/nusoap.php";

require_once $routes;

function hello(){

 

return 'Hello World!';

}

$soap = new soap_server();

$soap->register("hello");

//$HTTP_RAW_POST_DATA = ISSET($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'';

$soap->service(file_get_contents('php://input') );

}

客户端:

require_once 'lib/nusoap.php';

 

$client = new soapclient("http://127.0.0.1/ci/index.php/TestSoap");

 

//$paramenters = array("hello");

$str = $client->call('hello');

print_r($str);