public function req_unenrol_user(stdclass $user, stdclass $remotecourse) {
        global $CFG, $DB;
        require_once($CFG->dirroot.'/mnet/xmlrpc/client.php');

        $peer = new mnet_peer();
        $peer->set_id($remotecourse->hostid);

        $request = new mnet_xmlrpc_client();
        $request->set_method('enrol/mnet/enrol.php/unenrol_user');
        $request->add_param($user->username);
        $request->add_param($remotecourse->remoteid);

        if ($request->send($peer) === true) {
            if ($request->response === true) {
                // clear the cached information
                $DB->delete_records('mnetservice_enrol_enrolments',
                    array('hostid'=>$peer->id, 'userid'=>$user->id, 'remotecourseid'=>$remotecourse->remoteid, 'enroltype'=>'mnet'));
                return true;

            } else {
                return serialize(array('invalid response: '.print_r($request->response, true)));
            }

        } else {
            return serialize($request->error);
        }
    }