Hi:
VMware-vSphere-SDK-5.5 that different 5.1.
In 5.1 ,we use run Samples on "main" method.
For example:
args = new String[6];
args[0] = "--username";
args[1] = "root";
args[2] = "--password";
args[3] = "pass123word";
args[4] = "--url";
args[5] = "https://xxx.xx.xx.10/sdk";
getConnectionParameters(args);
if (help) {
printUsage();
return;
}
connect();
getCurrentTime();
I can run it by Java Application on eclipse,it work!
But, in 5.5
the code is:
@Action
public void getCurrentTime() throws RuntimeFaultFaultMsg {
XMLGregorianCalendar ct = vimPort.currentTime(this.getServiceInstanceReference());
SimpleDateFormat sdf =
new SimpleDateFormat("yyyy-MM-dd 'T' HH:mm:ss.SSSZ");
System.out.println("Server current time: "
+ sdf.format(ct.toGregorianCalendar().getTime()));
}
yes,the code is sample,but i do not how can i run this sample!
Thanks!