VMware

This Question is Not Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
0 Replies Last post: Aug 17, 2009 3:02 AM by thomasjulian  

How to use authentication and certificate to connect ESX/VC using java? posted: Aug 17, 2009 3:08 AM

Click to view thomasjulian's profile Novice 10 posts since
Feb 20, 2009
I obtained the certificate file using java keystore tool and then i added the following lines in my code for logging into the web service

System.setProperty("javax.net.ssl.trustStore","path for the keystore");


org.apache.axis.client.Stub clientStub = (org.apache.axis.client.Stub) WEB_SERVICE;
org.apache.axis.client.Call call = clientStub._getCall();
org.apache.axis.MessageContext msgContext = call.getMessageContext();
sessionID = (String) msgContext.getProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE);


and then i printed out the API version details.Then i call the method for getting VM details(name,runtime.powerState).But the objectContent[] returned is null.But i am able to get the VM details if i execute this method(method for getting VM details) alone in a seperate program(as given in sample programs).Any idea?

How to use the obtained session for further communication?


Thanks.

Developer Social Media

Communities