Hi,
I'm trying to begin to target the WebService of an ESX 4.1 directly in php with soap client.
I'm really surprised by the dificulty to get informations, I tried to follow the example showed on vsdk_prog_guide.pdf page 50, but it's unfortunately in java..
Despite it, I tried to follow the same step by direct soap call.
Here is what I get(without phases of login...) :
in the example:
------------------------------------------------------------------------------------------------------------------------------------------------
ManagedObjectReference viewMgrRef = sContent.getViewManager();
ManagedObjectReference propColl = sContent.getPropertyCollector();
------------------------------------------------------------------------------------------------------------------------------------------------
my code:
------------------------------------------------------------------------------------------------------------------------------------------------
$moRefViewManager = $ServiceContent->viewManager;
$moRefPropertyCol = $ServiceContent->propertyCollector;
------------------------------------------------------------------------------------------------------------------------------------------------
Then in the example:
------------------------------------------------------------------------------------------------------------------------------------------------
List<String> vmList = new ArrayList<String>();
vmList.add("VirtualMachine");
ManagedObjectReference cViewRef = methods.createContainerView(viewMgrRef,
sContent.getRootFolder(),
vmList,
true );
------------------------------------------------------------------------------------------------------------------------------------------------
my code:
------------------------------------------------------------------------------------------------------------------------------------------------
$soapmsg = NULL;
$result = $client->CreateContainerView(array("_this"=>$moRefViewManager,"container"=>$ServiceContent->rootFolder,"type"=>"VirtualMachine","recursive"=>"true"));
$moRefViewVMs = $result->returnval;
------------------------------------------------------------------------------------------------------------------------------------------------
int the example:
------------------------------------------------------------------------------------------------------------------------------------------------
ObjectSpec oSpec = new ObjectSpec();
oSpec.setObj(cViewRef);
oSpec.setSkip(true);
------------------------------------------------------------------------------------------------------------------------------------------------
Now I don't really know how to get the objectspec..
In a general way, are there some examples somewhere?
Is it the good way to look for datas in the inventory?
If you're not the good person to contact don't hesitate to tell!
Thanks