[xmlrpc]expat errors

[xmlrpc]expat errors

από Vamsi Krishna Davuluri -
Αριθμός απαντήσεων: 1
Hi,

I'm working on communication between moodle and my python based sugar activity.

Also, I'm very new to xml-rpc, and i'm trying to make this file http://xref.moodle.org/nav.html?mnet/rpclib.php.source.html
work under the assignment module. I have added assignment_mnet_publishes() to it, but when i call the functions after registering the server on "http://localhost/~iwikiwi/moodle/mod/assignment/rpclib.php", I get the expat error stating:

xml.parsers.expat.ExpatError: no element found: line 2, column 0

As a solution I have modified the script and used

$xmlrpc_server = xmlrpc_server_create();

xmlrpc_server_register_method
$request_xml = $HTTP_RAW_POST_DATA;
$response = xmlrpc_server_call_method($xmlrpc_server, $request_xml, '');
print $response;

It works like a charm then.
I was in the opinion that instantiating a server and everything was taken care internally?
If so could someone help me?

Thanks,
Vamsi
Μέσος όρος βαθμολογίας: -
Σε απάντηση σε Vamsi Krishna Davuluri

Re: [xmlrpc]expat errors

από Hubert Chathi -
The rpclib.php files are for Moodle Networks, which is based on XML-RPC, but is incompatible since it adds some security layers on top. There is no other web services implementation that comes with Moodle 1.9. Moodle 2.0 will come with various web services (XML-RPC, SOAP, REST, etc.).
If you want to use Moodle 1.9, you will either need to implement Moodle Networks in Python (which will probably be quite hard, as the protocol is not completely documented yet), or use the web services plugin from Moodle contrib (http://cvs.moodle.org/contrib/patches/ws/), which will provide a SOAP interface.