Leveraging the vSphere Web Services SDK via https://servername/sdk/vimService and authenticating with my creds...
I can submit a Login service call via SoapUI successfully:
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<LoginResponse xmlns="urn:vim25">
<returnval>
<key>A44E83AA-8342-4C38-9037-C37C006BABC3</key>
<userName>redacted</userName>
<fullName>redacted</fullName>
<loginTime>2011-06-21T17:14:53.714939Z</loginTime>
<lastActiveTime>2011-06-21T17:14:53.714939Z</lastActiveTime>
<locale>en</locale>
<messageLocale>en</messageLocale>
</returnval>
</LoginResponse>
</soapenv:Body>
</soapenv:Envelope>
Date | Tue, 21 Jun 2011 19:35:29 GMT |
#status# | HTTP/1.1 200 OK |
Content-Length | 677 |
Set-Cookie | vmware_soap_session="BD44857C-B359-4A7E-8E91-7993BE9AA9A1"; Path=/; |
Content-Type | text/xml; charset=utf-8 |
Connection | Keep-Alive |
Cache-Control | no-cache |
When I try to call FindByDNSName:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:vim25">
<soapenv:Header/>
<soapenv:Body>
<urn:FindByDnsName>
<urn:_this type="SearchIndex">SearchIndex</urn:_this>
<urn:dnsName>servername</urn:dnsName>
<urn:vmSearch>true</urn:vmSearch>
</urn:FindByDnsName>
</soapenv:Body>
</soapenv:Envelope>
Here is my response:
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>ServerFaultCode</faultcode>
<faultstring>The session is not authenticated.</faultstring>
<detail>
<NotAuthenticatedFault xsi:type="NotAuthenticated" xmlns="urn:vim25">
<object type="Folder">group-d1</object>
<privilegeId>System.View</privilegeId>
</NotAuthenticatedFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
It doesn't seem like I have to submit a "KEY" for these soap calls based on the documentation, but yet I get "The session is not authenticated". I am connecting to the same https url mentioned above and with my creds just the same as the Login method above.
I tried adding the header in soapUI and still get the same faultstring above
i.e. I get this back from the login soap call:
Set-Cookie | vmware_soap_session="BD44857C-B359-4A7E-8E91-7993BE9AA9A1"; Path=/; |
So, in soapUI I add that to the FindByDnsName request. The response is "The session is not authenticated" with these headers
Date | Tue, 21 Jun 2011 19:40:24 GMT |
#status# | HTTP/1.1 500 Internal Server Error |
Content-Length | 643 |
Set-Cookie | vmware_soap_session="145FE182-FCAB-4994-B1D3-FC9544BC4AD4"; Path=/; |
Content-Type | text/xml; charset=utf-8 |
Connection | Keep-Alive |
Cache-Control | no-cache |
So even though I submitted the vmware_soap_session the response came back with another sessionid...
So how do I format the proper soap call for FindByDnsName?
VMware vCenter Server 4.1.0 build-345043 / apiVersion="4.1"