[eluser]Unknown[/eluser]
class Websvr extends Controller {
function Websvr(){
parent::Controller();
}
function index()
{
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$this->load->library('MY_Xmlrpc');
$this->load->library('adodb_loader',array('group'=>'mssql'));
$config['functions']['rsyncpassword'] = array('function' => 'Websvr.rsyncpassword');
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}
function rsyncpassword($request){
$parameters_rsync = $request->output_parameters();
$response_rsync = array(
array('username' => $parameters_rsync['0'],'password' => $parameters_rsync['1']),
'struct'
);
$row = $this->adodb->getrow("SELECT * FROM baseinfo WHERE account = '{$response_rsync[0]['username']}'");
$returnData = array(
array('password'=>$row),
'struct'
);
return $this->xmlrpc->send_response($returnData);
}
}
?>
---DATA---
HTTP/1.1 200 OK
Date: Tue, 13 May 2008 06:03:12 GMT
Server: Apache/2.2.4 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
Content-Length: 306
Connection: close
Content-Type: text/xml
<hr />
(mssql): SELECT * FROM baseinfo WHERE account = 'testacc'
<hr />
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>password</name>
<value>
<string>123456</string>
</value>
</member>
</struct></value>
</param>
</params>
</methodResponse>
---END DATA---
Error:The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.
Is there any errors in the code?I don’t know what’s wrong with it.