Hello,
I am attempting to retrieve HostSystem
and VirtualMachine
data with the web services API after using the vimport.login()
method. I seem to be logging in just fine and retrieving the ServiceContent
without error but when I make my API call to retrieve data, I receive the following error
Client received SOAP Fault from server: The session is not authenticated. Please see the server log to find more detail regarding the exact cause of the failure.
I tried looking through the logs but did not find anything associated with that error. I was initially suspecting that I needed to add a cookie. I found an example in the web services guide for retrieving a cookie from the response headers from the RequestContext as shown below but no "Set-cookie" header exists
requestContext = ((BindingProvider) vimPort).getResponseContext();
headers = (Map<String, Object>) requestContext.get(MessageContext.HTTP_RESPONSE_HEADERS);
List cookies = (List) headers.get("Set-cookie");
Any help would be great!