Hi all, I have a question about how to print the parameter output in php using soap protocol.....I create the workflow with only 1 scriptable task with vms variable name as output parameter like this,
var sdkConnections = VcPlugin.allSdkConnections; vms = new Array(); for (var i in sdkConnections) { var host = sdkConnections[i]; var found; if (host.isInventoryServiceAvailable()) { found = host.getAllVirtualMachines(); } for (var j in found) { vms.push(found[j]); System.log(vms); } }
And my php source code like this,
<?php include ("parameters.inc"); $vco = new SoapClient('https://' . $vco_server . ':8281/vmware-vmo-webcontrol/webservice?WSDL'); $workflowid = "f73f2521-0e6b-48e8-81b9-388b13fc3fea"; $param = array(workflowId=>$workflowid,username=>$vco_user,password=>$vco_pass); echo '<br>'; $result3 = $vco->executeWorkflow($param); print_r($result3); echo '<br>'; foreach ($result3 as $token) { $tokenID = $token->id; } $param2 = array(workflowTokenId=>$tokenID,username=>$vco_user,password=>$vco_pass); $wftokenstatus = $vco->getWorkflowTokenStatus($param2); print_r($wftokenstatus); echo '<br>'; $wftokenresult = $vco->getWorkflowTokenResult($param2); print_r($wftokenresult); echo '<br>'; ?>
When I try to running in web the output like this,
stdClass Object ( [executeWorkflowReturn] => stdClass Object ( [id] => ff808081440b6eb90144316de4bc04fe [title] => Copy of Get virtual machines by name [workflowId] => f73f2521-0e6b-48e8-81b9-388b13fc3fea [currentItemName] => __item-undefined__ [currentItemState] => running [globalState] => running [businessState] => [startDate] => 20140215002449+0700 [endDate] => [xmlContent] => ) ) stdClass Object ( [getWorkflowTokenStatusReturn] => ) stdClass Object ( [getWorkflowTokenResultReturn] => stdClass Object ( [name] => vms [type] => VC:VirtualMachine [value] => ) )
I see in orchestrator client, my workflow running smoothly and in Logs tab I can see all of my VM appear but I try to print all array component in my php script using print_r(), the object value always null, only can get name and type like in above....Any idea how to get the output parameter value?..thanks before