VMware {code} Community
dikang85
Contributor
Contributor

How to invoke a method of a managed object (in vi java sdk)

As per subject.

for example:

How to invoke the CurrentTime method to get the local time on the esx server?

Thank

Dikang

Reply
0 Kudos
1 Reply
lamw
Community Manager
Community Manager

You may want to look in the Java forum for some sample code to help you get started:

Basically you'll need to get a reference to the managed object reference, and in this case a reference to the service content and invoke the method. There should be plenty of sample code, including a hello world and connect code to help get started.

You'll probably also want to look over the vSphere SDK reference: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/index.html

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos