by Juan Leyva.
Hi,
I'd recommend you to use the REST client instead the XMLRPC one, I remember that passing parameters to the XMLRPC is not very intuitive. https://github.com/moodlehq/sample-ws-clients
I'd recommend you this code change:
$enrolobj = new stdClass(); // Do it before assigning values.
Hope it helps, Juan