客户端代码:
<?php $client = new SoapClient(null, array('location'=>"http://192.168.1.100/test/serverSoap.php",'uri' =>"http://soap/")); echo $client->show(); ?>
<?php class test{ function show(){ return 'the data you request'; } } function getUserInfo($name){ return 'fbbin'; } $soap = new SoapServer(null, array('uri'=>'http://soap/','location'=>'http://localhost/test/serverSoap.php')); $server->serClass('test'); $server->handle();?>
太粗心了,这样写
<?php class test{ function show(){ return 'the data you request'; } } function getUserInfo($name){ return 'fbbin'; } $server = new SoapServer(null, array('uri'=>'http://soap/','location'=>'http://localhost/test/serverSoap.php')); $server->setClass('test'); $server->handle();?>
补充下
<?php class test{ function show(){ return 'the data you request'; } function getUserInfo($name){ return 'fbbin'; } } $server = new SoapServer(null, array('uri'=>'http://soap/','location'=>'http://localhost/test/serverSoap.php')); $server->setClass('test'); $server->handle();?>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号