Quantcast
Channel: VMware Communities: Message List - vSphere Management SDK
Viewing all articles
Browse latest Browse all 2052

Re: A few problems with API

$
0
0

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.


Viewing all articles
Browse latest Browse all 2052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>