调用webservice的第二种方式的错误读取是怎样的
php code require('./soap_lib/nusoap.php'); require('./include.php'); ini_set(soap.wsdl_cache_enabled, 1);$s = new soapclient(url_site./webservices/service1.asmx?wsdl); $s->soap_defencoding = 'utf-8'; $s->decode_utf8 = false;// $result=$s->call('userinfo',array('user'=> urldecode($_get['username']))); $result=$s->userinfo(array('user'=> urldecode($_get['username']))); //var_dump($result);exit;// if (!$err=$s->geterror()) { // $list=explode(;,$result[userinforesult]);// array_pop($list);// } else { $list=explode(;,$result->userinforesult); array_pop($list); ?>
注释掉的部分是之前的调用ws的方式,换了主机之后居然不支持了,,接着找谷歌,发现第二种方式,但是没指明怎样抓取错误信息
导致的问题是如果
$result=$s->userinfo(array('user'=> urldecode($_get['username'])));
执行出来没有数据
提示
fatal error: uncaught soapfault exception: [soap:server] system.web.services.protocols.soapexception: 服务器无法处理请求。 ---> system.indexoutofrangeexception: 在位置 0 处没有任何行。 在 system.data.rbtree`1.getnodebyindex(int32 userindex) 在 system.data.rbtree`1.get_item(int32 index) 在 system.data.datarowcollection.get_item(int32 index) 在 webservice1.service1.userinfo(string user) 位置
questions:
if (!$err=$s->geterror()) 这个方法失效了 该怎么写
------解决方案--------------------
什么时候把头像换了
------解决方案--------------------
webservice1.service1.userinfo(string user)
这个是.net。
user 是strin格式。