Hi Guys! Forum  moderator suggests me to contact somebody from developers to 
solve my problem faster than waiting answer on forum. 
I have a trouble setting boolean values via SOAP for VBOX. 
Actually, I need to set IMachine_setHPETEnabled to True programmatically, but 
IMachine_setCPUHotPlugEnabled also doesn't work. 
Trying to set these parameters always follows with Machine is not mutable 
error. But setting of memory like in SDK example works fine. 
What I'm actually do. I using suds SOAP client library for Python. 

This is part of a vbox web server wrapper's code: def __init__(self, 
wsdlFileName, hostString, username = '', password = '', SessionId = None, 
VboxID=None): 
 wsdlFile = urllib.parse.urljoin('file:', urllib.request.pathname2url(path + 
"\\" + wsdlFileName)) 
 self.client = Client(wsdlFile, location = hostString) 
 self.VboxID = self.client.service.IWebsessionManager_logon(username, password) 
 self.SessionId = 
self.client.service.IWebsessionManager_getSessionObject(self.VboxID) 

 def RestoreSnapshot(self, machineName, SnapshotName): 
        self.MachineName = machineName 
        self.MachineUID = 
self.client.service.IVirtualBox_findMachine(self.VboxID, machineName) 
        snapShotId = self.client.service.IMachine_findSnapshot(self.MachineUID, 
SnapshotName) 
        writableMachineUID = 
self.__lockMachineGetWritableUID__(self.MachineUID, self.SessionId) 
        consoleId = self.client.service.ISession_getConsole(self.SessionId) 
         self.client.service.IConsole_restoreSnapshot(consoleId, snapShotId) 
        self.__unlockMachine__(writableMachineUID, self.SessionId) 
        return snapShotId 

def SetHpet(self,state): 
        writableMachineUID = 
self.__lockMachineGetWritableUID__(self.MachineUID, self.SessionId) 
        try: 
            
self.client.service.IMachine_setHPETEnabled(writableMachineUID,True)<< Machine 
is not mutable error here 
            
#self.client.service.IMachine_setMemorySize(writableMachineUID,1024) <<this is 
works here!!! 
        finally: 
            self.__unlockMachine__(self, writableMachineUID, self.SessionId) 


Code that uses mentioned lib: 
wsdfl_file_name='vboxwebService-4.2.wsdl' 
vbWebCtrl1=VBoxWebControl(wsdfl_file_name,'localhost_url:18083/') 
vbWebCtrl1.RestoreSnapshot('Win7x64_1','TestSnapshot') 
vbWebCtrl1.SetHpet(True)<< here I use true and 'true' and 'True' - nothing was 
changed- same error 
vbWebCtrl1.StartVM() 

Setting of HPET works perfectly via commandline. Please, let me know what I'm 
doing wrong or fix this. 

VBOX info:   
VM VirtualBox web service Version 4.3.12 
VirtualBox web service 4.3.12 r93733 
Webserver 
Python 
Win7x64     With best regards, Yuriy Tretyakov   
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to