by Suraj Kumar.
I would like to add one point here that I got going through the moodle tracker regarding calling web service function through xml-rpc client.If we are using moodle version < 3.1 , then we should use
header('Content-Type: text/plain');For moodle version 3.1 onward,
$curl->setHeader('Content-type: text/xml');
Moodle tracker link - https://tracker.moodle.org/browse/MDL-54808