<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def xmlrpc_save2file(self, filename):
 """ Save results and own state into file. """

        savefile = open(filename,'wb')
        try:
            pickle.dump({'scheduled':self.scheduled_tasks,
                          'reschedule':self.reschedule},savefile)
        except pickle.PicklingError:
            return -1
        savefile.close()
        return 1