-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to determine type of Any error #3
Comments
Hey sorry for the very very late reply. I will take a look into this. |
Still looking couldn't find a solution yet. I will get back. |
I encountered this same problem when writing my own code for talking to vSphere (back in late 2012, before this project even existed), and I managed to find a solution: iterate across $vmExConf and reassign all of the values with "new SoapVar($value, XSD_STRING, 'xsd:string')". |
@quietust Could you please provide a working example? I try since 2 days to get this working :( Currently, i try something like that:
I would be grateful for any help. |
I got it working :)
|
Hi, great job! everything went fine until I try some codes to modify vm's extraConfig.
$vm = $vhost->findManagedObjectByName('VirtualMachine', 'new', array('config'));
$vmconf = $vm->config;
$vmExConf = $vmconf->extraConfig;
$vmExConf1[] = new OptionValue('RemoteDisplay.vnc.enabled','true');
$vmcs = new VirtualMachineConfigSpec();
$vmcs->extraConfig = $vmExConf1;
$vm->ReconfigVM_Task(array('spec'=>$vmcs));
here is the error message(Webservice faultString):
PHP Fatal error: Uncaught SoapFault exception: [ServerFaultCode]
Unable to determine type of Any
error parsing Any value
at line 2, column 253
while parsing property "value" of static type anyType
while parsing serialized DataObject of type vim.option.OptionValue
at line 2, column 192
while parsing property "extraConfig" of static type ArrayOfOptionValue
while parsing serialized DataObject of type vim.vm.ConfigSpec
at line 2, column 182
while parsing call information for method ReconfigVM_Task
at line 2, column 115
while parsing SOAP body
at line 2, column 100
while parsing SOAP envelope
at line 2, column 0
while parsing HTTP request for method reconfigure
on object of type vim.VirtualMachine
at line 1, column 0 in C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php:68
Stack trace:
#0 C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php(68): SoapClient->__call('ReconfigVM_Task', Array)
#1 C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php(68): Vmwarephp\SoapClient->ReconfigVM_Task(Array)
#2 C:\wamp in C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php on line 68
I track down the soap request, do it in SoapUI, same error message shows.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:vim25">
SOAP-ENV:Body
ns1:ReconfigVM_Task
<ns1:_this type="VirtualMachine">2/ns1:_this
ns1:spec
ns1:extraConfig
ns1:keyRemoteDisplay.vnc.enabled/ns1:key
ns1:valuetrue/ns1:value
/ns1:extraConfig
/ns1:spec
/ns1:ReconfigVM_Task
/SOAP-ENV:Body
/SOAP-ENV:Envelope
I'm pretty sure ns1:valuetrue/ns1:value is the cause the problem, I look into the source code OptionValue class which indicate 'value' property is a type of //AnyType. Is there anyway I can quick fix this, thanks.
The text was updated successfully, but these errors were encountered: