vadimcomanescu / vmwarephp

Vmwarephp - vSphere API bindings for PHP
Other
75 stars 67 forks source link

soap fault when calling EnterMaintenanceMode_Task or RebootHost_Task #19

Open ZsBT opened 9 years ago

ZsBT commented 9 years ago

It seems second parameter disappears before the last SOAP call:

$task = $vhost->EnterMaintenanceMode_Task( $hosts, -1  );

PHP Fatal error: SOAP-ERROR: Encoding: object has no 'timeout' property in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php on line 71

PHP Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'Client: SOAP-ERROR: Encoding: object has no 'timeout' property. ' in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php:74

$task = $vhost->RebootHost_Task( $host, false  );

PHP Fatal error: SOAP-ERROR: Encoding: object has no 'force' property in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php on line 71

PHP Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'Client: SOAP-ERROR: Encoding: object has no 'force' property. ' in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php:74

Tried to debug in Service.php:74 , print_r($soapMessage) shows that the second parameter is indeed missing.

The server is esxcli 5.5

okorneliuk commented 5 years ago

$task = $host->EnterMaintenanceMode_Task(['timeout' => 300]); this syntax works nice for me