package xCAT::vboxService;

# Generated by SOAP::Lite (v0.712) for Perl -- soaplite.com
# Copyright (C) 2000-2006 Paul Kulchenko, Byrne Reese
# -- generated at [Wed Mar 26 20:28:01 2014]
# -- generated from file:///home/vbox/tinderbox/4.3-sdk/out/linux.amd64/release/obj/webservice/vboxwebService.wsdl
# -- merged V3 API Methods at [Sun Apr 06 13:31:00 2014]
# -- manually added defintions for xCAT integration of both versions by Herbert Mehlhose, IBM
# -- reduce methods hash to the needed interface functionality needed for our purpose
my %methods = (
    IVirtualBox_getExtraData => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'key',   type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getExtraData
    IMachine_getName => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getName
    IProgress_getTimeout => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getTimeout
    IVRDEServer_setVRDEProperty => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'key',   type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'value', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_setVRDEProperty
    IConsole_powerDown => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_powerDown
    IConsole_getPowerButtonHandled => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_getPowerButtonHandled
    IManagedObjectRef_release => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IManagedObjectRef_release
    IMachine_saveSettings => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_saveSettings
    IMachine_getExtraData => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'key',   type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getExtraData
    IProgress_getPercent => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getPercent
    IProgress_getOperationPercent => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getOperationPercent
    IVirtualBox_getAPIVersion => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getAPIVersion
    IMachine_setExtraData => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'key',   type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'value', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_setExtraData
    IVRDEServer_getEnabled => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getEnabled
    IProgress_waitForCompletion => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'timeout', type => 'xsd:int', attr => {}),
        ],    # end parameters
    },    # end IProgress_waitForCompletion
    IMachine_getState => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getState
    IVirtualBox_getGuestOSTypes => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getGuestOSTypes
    IMachine_launchVMProcess => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'session', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'type', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'environment', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_launchVMProcess
    IMachine_getGuestProperty => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'name',  type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getGuestProperty
    IVirtualBox_openMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'settingsFile', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_openMachine
    IVRDEServer_getAuthLibrary => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getAuthLibrary
    IVRDEServer_setAuthTimeout => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'authTimeout', type => 'xsd:unsignedInt', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_setAuthTimeout
    IProgress_setTimeout => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'timeout', type => 'xsd:unsignedInt', attr => {}),
        ],    # end parameters
    },    # end IProgress_setTimeout
    IConsole_getMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_getMachine
    IProgress_waitForAsyncProgressCompletion => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'pProgressAsync', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_waitForAsyncProgressCompletion
    IConsole_powerUp => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_powerUp
    ISession_getType => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getType
    IVirtualBox_getVersion => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getVersion
    IMachine_setGuestProperty => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'property', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'value', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'flags', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_setGuestProperty
    IVirtualBox_findMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'nameOrId', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_findMachine
    IVRDEServer_setAuthType => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'authType', type => 'vbox:AuthType', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_setAuthType
    IConsole_getDisplay => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_getDisplay
    IConsole_getGuest => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_getGuest
    IProgress_waitForOperationCompletion => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'operation', type => 'xsd:unsignedInt', attr => {}),
            SOAP::Data->new(name => 'timeout', type => 'xsd:int', attr => {}),
        ],    # end parameters
    },    # end IProgress_waitForOperationCompletion
    IVirtualBox_getMachines => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getMachines
    IProgress_getResultCode => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getResultCode
    IProgress_getCompleted => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getCompleted
    IMachine_lockMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'session', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'lockType', type => 'vbox:LockType', attr => {}),
        ],    # end parameters
    },    # end IMachine_lockMachine
    IMachine_getSessionType => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getSessionType
    IVirtualBox_getSystemProperties => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getSystemProperties
    IProgress_getOperation => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getOperation
    ISession_getState => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getState
    IVRDEServer_getVRDEProperties => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getVRDEProperties
    IConsole_reset => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_reset
    IMachine_getSessionState => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getSessionState
    IVRDEServer_getVRDEProperty => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'key',   type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getVRDEProperty
    IVirtualBox_getMachineStates => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'machines', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getMachineStates
    IVRDEServer_getAuthType => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getAuthType
    IMachine_getVRDEServer => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getVRDEServer
    IProgress_getErrorInfo => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getErrorInfo
    ISystemProperties_getVRDEAuthLibrary => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISystemProperties_getVRDEAuthLibrary
    IMachine_getId => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getId
    ISession_getMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getMachine
    IMachine_showConsoleWindow => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_showConsoleWindow
    IProcess_getStatus => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProcess_getStatus
    IVRDEServer_getVRDEExtPack => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_getVRDEExtPack
    ISession_getConsole => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getConsole
    IWebsessionManager_logon => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => 'username', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'password', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IWebsessionManager_logon
    IWebsessionManager_logoff => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => 'refIVirtualBox', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IWebsessionManager_logoff
    IVRDEServer_setEnabled => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'enabled', type => 'xsd:boolean', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_setEnabled
    IConsole_powerButton => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_powerButton
    IVRDEServer_setAuthLibrary => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'authLibrary', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDEServer_setAuthLibrary
    ISession_unlockMachine => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_unlockMachine
    IMachine_getDescription => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getDescription
    ISystemProperties_setVRDEAuthLibrary => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'VRDEAuthLibrary', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISystemProperties_setVRDEAuthLibrary
    IWebsessionManager_getSessionObject => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => 'refIVirtualBox', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IWebsessionManager_getSessionObject
    IProgress_getId => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getId
    IVirtualBox_getVersionNormalized => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_getVersionNormalized

######################################################################
### starting v3 additions for backward compatibility with vbox 3.2 ###
######################################################################

    # findMachine - change in parameter name / nameOrId
    IVirtualBox_findMachine_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'name',  type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_findMachine
    IMachine_getState_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getState
    IMachine_getId_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getId
    IWebsessionManager_getSessionObject_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => 'refIVirtualBox', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IWebsessionManager_getSessionObject
    IVirtualBox_openSession_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'session', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'machineId', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_openSession
    ISession_getMachine_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getMachine
    IMachine_getVRDPServer_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getVRDPServer
    IVRDPServer_getEnabled_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_getEnabled
    IVRDPServer_setEnabled_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'enabled', type => 'xsd:boolean', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_setEnabled

    # from API version 3.0 to 3.1, the 'port' attribute has been changed to 'ports'
    IVRDPServer_getPorts_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_getPorts
    IVRDPServer_getPort_V30 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_getPort
    IVRDPServer_setPorts_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'ports', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_setPorts
    IVRDPServer_setPort_V30 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'port', type => 'xsd:unsignedInt', attr => {}),
        ],    # end parameters
    },    # end IVRDPServer_setPort
    IMachine_saveSettings_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_saveSettings
    IManagedObjectRef_release_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IManagedObjectRef_release
    ISession_close_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_close
    IVirtualBox_openRemoteSession_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'session', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'machineId', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'type', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'environment', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_openRemoteSession
    IProgress_waitForCompletion_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'timeout', type => 'xsd:int', attr => {}),
        ],    # end parameters
    },    # end IProgress_waitForCompletion
    IProgress_getCompleted_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IProgress_getCompleted
    IMachine_getSessionState_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IMachine_getSessionState
    IVirtualBox_openExistingSession_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'session', type => 'xsd:string', attr => {}),
            SOAP::Data->new(name => 'machineId', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IVirtualBox_openExistingSession
    ISession_getConsole_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end ISession_getConsole
    IConsole_reset_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_reset
    IConsole_powerButton_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_powerButton
    IConsole_powerDown_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_powerDown
    IConsole_getPowerButtonHandled_V3 => {
        endpoint   => 'http://localhost:18083/',
        soapaction => '',
        namespace  => 'http://www.virtualbox.org/',
        parameters => [
            SOAP::Data->new(name => '_this', type => 'xsd:string', attr => {}),
        ],    # end parameters
    },    # end IConsole_getPowerButtonHandled
);        # end my %methods

#use SOAP::Lite; # vbox.pm requires SOAP::Lite before requiring vboxService.pm, so we can check for SOAP::Lite dynamically
use Exporter;
use Carp ();

use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter SOAP::Lite);

#L("Setting EXPORT_OK array...");
@EXPORT_OK = (keys %methods);

#foreach(sort @EXPORT_OK) {L("M:$_");}
%EXPORT_TAGS = ('all' => [@EXPORT_OK]);

sub _call {
    #######################################################################################################################################################
    # save the additional parameter "vboxhost" which contains an URL with Port information
    #my ($self, $method, $api, $vboxhost) = (shift, shift, shift, shift);
    my ($self, $method, $vboxhost) = (shift, shift, shift);
    my $name = UNIVERSAL::isa($method => 'SOAP::Data') ? $method->name : $method;

    #L("Function: $name()");
    my %method = %{ $methods{$name} };
    #######################################################################################################################################################
    # set the proxy to $vboxhost instead of $method{endpoint} -> in future vboxhost could contain something like "[*P*<proxyurl>*P*]<hosturl>"
    $self->proxy($vboxhost || Carp::croak "No server address (proxy) specified")
      unless $self->proxy;
    my @templates  = @{ $method{parameters} };
    my @parameters = ();
    foreach my $param (@_) {
        if (@templates) {

            #L("Parm(T): $param");
            my $template = shift @templates;
            my ($prefix, $typename) = SOAP::Utils::splitqname($template->type);
            my $method = 'as_' . $typename;

            # TODO - if can('as_'.$typename) {...}
            #L(Data::Dumper->Dump([$template], [qw(TMPL)]));
            my $result = $self->serializer->$method($param, $template->name, $template->type, $template->attr);

            #L(Data::Dumper->Dump([$result], [qw(RESULT)]));
            #L("Parm: " . $template->name . " Type: " . $template->type . " Val: " . $result->[2]);
            push(@parameters, $template->value($result->[2]));
        }
        else {
            #L("Parm(nonT): $param");
            push(@parameters, $param);
        }
    }
    #######################################################################################################################################################
    # set the endpoint to $vboxhost instead of $method{endpoint} -> in future vboxhost could contain something like "[*P*<proxyurl>*P*]<hosturl>"
    $self->endpoint($vboxhost)
      ->ns($method{namespace})
      ->on_action(sub { qq!"$method{soapaction}"! });
    $self->serializer->register_ns("urn:vbox",                   "interface");
    $self->serializer->register_ns("http://www.virtualbox.org/", "vbox");
    $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/soap/", "soap");

    # strip off possible version extensions '_Vx' at end of method name
    $method =~ s/$\_V[0-9.]*//i;

    #L("about to super call with stripped method $method..");
    my $som = $self->SUPER::call($method => @parameters);
    if ($self->want_som) {
        return $som;
    }
    UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result : $som;
}

sub BEGIN {
    no strict 'refs';
    for my $method (qw(want_som)) {
        my $field = '_' . $method;
        *$method = sub {
            my $self = shift->new;
            @_ ? ($self->{$field} = shift, return $self) : return $self->{$field};
          }
    }
}
no strict 'refs';
for my $method (@EXPORT_OK) {
    my %method = %{ $methods{$method} };
    *$method = sub {
        my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
          ? ref $_[0]
              ? shift  # OBJECT
                       # CLASS, either get self or create new and assign to self
              : (shift->self || __PACKAGE__->self(__PACKAGE__->new))

              # function call, either get self or create new and assign to self
          : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));

        #L("CALL: $method");
        #foreach(@_) {L("   P:$_");}
        $self->_call($method, @_);
      }
}

sub AUTOLOAD {
    my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
    return if $method eq 'DESTROY' || $method eq 'want_som';
    die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n";
}

#sub L {
#	my $string=shift;
#	open FILE, ">>/tmp/soapxcatlog.txt";
#	print FILE "LOG: $string\n";
#	close FILE;
#}


1;

