I'm trying to log in to ESXi 4.1 programatically but my platform doesn't support either the java or c# sdks so I'm building my own from soap to work against the web SDK. Currently I get two packets sent (RetrieveServiceContent and Login) with the second one failing claiming the session is not authenticated. My packet text is below (with the password omitted) taken directly from wireshark. Everything looks in order as far as this is concerned. I have noticed in a trace taken using the SDK there are a handful of packets that hit the HTTP server that aren't soap packets between the RetrieveServiceContent and the Login packets. Is there something in there I'm missing? Thanks.
Hi MZeb,
You can take a look at the open source VI Java API implementation, mostly the com.vmware.vim25.mo.ws package
http://vijava.svn.sourceforge.net/viewvc/vijava/trunk/src/com/vmware/vim25/ws/
In particular the WSClient.java will be very helpful for you.
On top of my head, one thing that might be missing is to capture the cookie from your first SOAP response and send it back in your second request.
Steve Jin (http://www.doublecloud.org)
Yep, it was the cookie. Was so caught up in the soap XML didn't even think to check the http header. Thanks much, login going great now.