您好,欢迎访问一九零五行业门户网

容易的soap出错.

简单的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中:

server.php是:
usr_service));
$server->setclass('usrhelper');
$server->handle();
?>
调用服务的时候:
$client = new soapclient(null, array(
'location' => http://127.0.0.1/photowall/server.php,
'uri' => usr_service,
'trace' => 1 ));
//$client->addusr($username,$password);
$ans = $client -> test();
echo $ans;
------解决方案--------------------
你没有wsdl 或者 asmx文件吗? 错误好像是希望你能提供一个xml格式的文件
------解决方案--------------------
经测试,你贴出的代码没有任何问题。可以得到结果 this is a test
观察你贴出的错误信息(这可不是乱码噢),错误出现在 registeraction.php 第22行相关的代码中,
而你贴出的代码要少的多。
其它类似信息

推荐信息