HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   SOAP Error: looks like we got no XML document (http://www.howtoforge.com/forums/showthread.php?t=62307)

mrtnzlml 21st June 2013 09:09

SOAP Error: looks like we got no XML document
 
Hi! I have problem with client_update remote API function. It returns SOAP Error: looks like we got no XML document...
Code:

if($session_id = $client->login($username,$password)) {
        echo 'Logged successfull. Session ID:'.$session_id.'<br />';    //OK
}
$client_record = $client->client_get($session_id, $client_id);    //OK
$vals['contact_name'] = 'brush';
$new_record = array_merge($client_record, $vals);    //OK, contact_name changed
$affected_rows = $client->client_update($session_id, $client_id, $reseller_id, $new_record);    //FAIL

In catch $client->__getLastResponse() contains incomplete response:
Code:

... `usertheme` = 'default', `street` = '', `zip` = '', `city` = '', `state` = '', `country` = 'CZ', `telephone` = '', `mobile` = '', `fax` = '', `em
(last em - probably email is incomplete) and SoapFault -> getMessage returns looks like we got no XML document.

Any idea where is the problem?

till 21st June 2013 09:19

The output is a sql error message, so there might be something wrong with the params array that you passed to the client_update function.

mrtnzlml 21st June 2013 09:29

Is there any difference between result of function client_get and input params of function client_update? I tried this:
Code:

$client_record = $client->client_get($session_id, $client_id);
$client->client_update($session_id, $client_id, $reseller_id, $client_record);

(Just get and immediately return back this record.) And i got almost the same... SOAP Error: looks like we got no XML document.

mrtnzlml 21st June 2013 14:11

Any ideas please?

mrtnzlml 21st June 2013 22:51

So I finally solved it. But that was really, really hard...
Unfortunately function client_update doesn't work at all. I think there is bug in file remoting_libs.inc.php in function getSQL on line 787 and 788. Creating SQL statement is not correct:
Code:

$sql_update .= '`sys_userid` = '.$this->sys_userid.', ';
$sql_update .= '`sys_groupid` = '.$this->sys_default_group.', ';

After bug resolved:
Code:

$sql_update .= '`sys_userid` = "'.$this->sys_userid.'", ';
$sql_update .= '`sys_groupid` = "'.$this->sys_default_group.'", ';

(quotation marks) Now it return correct SQL statement and function client_update works again. Please check this notice and please fix it as soon as possible.

synxmax 5th January 2014 00:00

Dude you saved my head and our wall , thank you thank you thank you

Quote:

Originally Posted by mrtnzlml (Post 298953)
So I finally solved it. But that was really, really hard...
Unfortunately function client_update doesn't work at all. I think there is bug in file remoting_libs.inc.php in function getSQL on line 787 and 788. Creating SQL statement is not correct:
Code:

$sql_update .= '`sys_userid` = '.$this->sys_userid.', ';
$sql_update .= '`sys_groupid` = '.$this->sys_default_group.', ';

After bug resolved:
Code:

$sql_update .= '`sys_userid` = "'.$this->sys_userid.'", ';
$sql_update .= '`sys_groupid` = "'.$this->sys_default_group.'", ';

(quotation marks) Now it return correct SQL statement and function client_update works again. Please check this notice and please fix it as soon as possible.



All times are GMT +2. The time now is 18:42.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.