简单的soap出错...
一直报错:
锘?
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in E:\xampp\htdocs\photowall\registeraction.php:22 Stack trace: #0 E:\xampp\htdocs\photowall\registeraction.php(22): SoapClient->__call('test', Array) #1 E:\xampp\htdocs\photowall\registeraction.php(22): SoapClient->test() #2 {main} thrown in E:\xampp\htdocs\photowall\registeraction.php on line 22
上面那个乱码有点诡异....因为它是在我没有输出任何东西的情况下出现的....
不知道是神马意思....
求问各位大神到底哪里出错了...
下面是代码:
一个类,在usrHelper.php中:
<?php<br />class usrHelper<br />{<br /> public function test()<br /> {<br /> return "this is a test";<br /> }<br />}<br />?><?php<br /><br />require_once 'usrHelper.php';<br /><br />$server = new SoapServer(null, <br /> array('uri' => "usr_service"));<br />$server->setClass('usrHelper');<br />$server->handle();<br />?><br />$client = new SoapClient(null, array(<br /> 'location' => "http://127.0.0.1/photowall/server.php",<br /> 'uri' => "usr_service",<br /> 'trace' => 1 ));<br />//$client->addUsr($username,$password);<br />$ans = $client -> test();<br />echo $ans;
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号