5.5.1

Table Of Contents
You created a connection to the Orchestrator Web service, verified the connection, and established what
technologies plug in to the Orchestrator server.
What to do next
Find objects in the Orchestrator server through the Web service connection.
Find Objects in the Orchestrator Server
To perform any useful task with a workflow, you must find the objects on which the workflow will run. The
Orchestrator Web service API provides functions for finding objects of all types in the VMware
Infrastructure inventory.
Workflows typically run on objects in the vCenter Server. Workflows can also run on objects from outside
the vCenter Server by accessing them through plug-ins.
The operations that the Web service API defines for finding objects are as follows.
n
find
n
findForId
n
findRelation
n
hasChildrenInRelation
All of the operations that find objects return FinderResult objects, either individually, as an array, or
embedded in a QueryResult object.
Find Objects by Using the find Operation
You can use the find operation to find objects of any type that match a particular search criterion, that you
set in the query parameter.
The vso.xml file of the plug-in through which you access the object defines the syntax of the query
parameter.
Prerequisites
You must have created a connection to the Orchestrator Web services endpoint in your Web service client
application class.
Procedure
1 Create a QueryResult object by calling the find operation on an object.
The following code example shows how an application can call the find operation to find out how
many virtual machines are accessible by a particular user through the vCenter Server plug-in.
QueryResult queryResult = vsoWebControl.find("VC:VirtualMachine", null,
<username>, <password>);
if (queryResult != null) {
System.out.println("Found " + queryResult.getTotalCount() +
" objs.");
FinderResult[] elts = queryResult.getElements();
finderResult = elts[0];
displayFinderResult(finderResult);
Developing a Web Services Client for VMware vCenter Orchestrator
58 VMware, Inc.