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.

This is my code to retrieve 'datastore' property of a host but am presented with a soap exception which saus "required

 

$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);

 

Where am I doing wrong? I have followed steps according to web service API reference.

Please assist me. I think retrieving the reference to datastore is the last thing I should provide in order to achieve my goal which is deploying, reconfiguring and customizing the guest OS all via API.

 

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>