What is the second method of abnormal reading when webservice is called?

Source: Internet
Author: User
What is the PHPcoderequire (. soap_libnusoap.php); require (. include. php); ini_set (& quot; soap. wsdl_cache_enabled & quot;, & quot; 1 & quot;); $ s what is the second method of error reading when webservice is called
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); ?>



The comments are based on the previous method of calling ws, which is not supported after the host is changed. then, we went to Google and found the second method, but did not specify how to capture the error message.

The cause is that if
$ Result = $ s-> UserInfo (array ('user' => urldecode ($ _ GET ['username']);

No data is executed.


Prompt

Fatal error: Uncaught SoapFault exception: [soap: Server] System. Web. Services. Protocols. SoapException: The Server cannot process the request. ---> System. IndexOutOfRangeException: no row exists at position 0. In System. data. RBTree '1. getNodeByIndex (Int32 userIndex) in System. data. RBTree '1. get_Item (Int32 index) in System. data. dataRowCollection. get_Item (Int32 index) in WebService1.Service1. userInfo (String user) Location



Questions:


If (! $ Err = $ s-> getError () is invalid.


------ Solution --------------------
When will I change my avatar?
------ Solution --------------------
WebService1.Service1. UserInfo (String user)

This is. NET.
User is in STRIN format.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.