Hi.
I managed to use the following code to retrive properties of host ad get its datastore property but I get the following Soap Fault
// Get datastore | |||||
$prop_set = array(new SoapVar(array('all' => true, | |||||
'type' => "Datastore" | |||||
), SOAP_ENC_OBJECT, "PropertySpec")); |
$spec_set = array(new SoapVar(array('propSet' => $prop_set, | |||||
'reportMissing' => false | |||||
), SOAP_ENC_OBJECT, "PropertyFilterSpec")); |
$soap_message["_this"] = $service_instance->propertyCollector; | |
$soap_message["specSet"] = $spec_set; | |
$soap_message["options"] = new SoapVar(array(), SOAP_ENC_OBJECT, "RetrieveOptions"); | |
$result = $client->RetrievePropertiesEx($soap_message); | |
$datastore = $result->returnval; | |
print_r($datastore); |
Error:
SoapFault exception: [ServerFaultCode] Required property type is missing from data object of type PropertySpec while parsing serialized DataObject of type vmodl.query.PropertyCollector.PropertySpec
What is wrong with my code?
Thanks in advance.