Connections to the server machine require
credentials: user name, password, and host name (or IP address). The following
code connects to the server and extracts information useful for manipulating a
service:
Procedure
1
Create the service instance
moRef:
ManagedObjectReference svcRef = new ManagedObjectReference();
svcRef.setType("ServiceInstance");
svcRef.setValue("ServiceInstance");
2
Locate the service:
VimServiceLocator locator = new VimServiceLocator();
locator.setMaintainSession(true);
VimPortType serviceConnection = locator.getVimPort("https://your_server/sdk");