It's done when you call Util::connect() (which calls the login function). Once you have successfully logged in, you can get the ServiceContent object by calling Vim::get_service_content(). If...
See more...
It's done when you call Util::connect() (which calls the login function). Once you have successfully logged in, you can get the ServiceContent object by calling Vim::get_service_content(). If you were to enable HTTP mode and capture the SOAP envelopes, you'd see the RetrieveServiceContent call. In a non-script SDK, such as Java, C++, raw SOAP, etc, you'd have to make this call, establish a sessionId cookie, and perform a login within that sessionId cookie to perform most functions against the VIM SDK. In the Perl SDK you can do the following if you want the ServiceContent (and references to many of the management objects in the inventory): $sc = Vim::get_service_content(); print $sc->about->fullName . "\n"; my $rootFolderMOR = $sc->rootFolder; Also, if I recall correctly, object views will have the Vim & ServiceContent as a property in their object data. print $vm_view->{'vim'}->{'service_content'}->{'about'}->{'fullName'} . "\n"; Since the ServiceInstance has the same MOREF value regardless, usually you'll just create a ManagedObjectReference directly and use it as a parameter to RetrieveServiceContent. my $ServiceInstance = ManagedObjectReference->new( type => 'ServiceInstance', value => 'ServiceInstance' ); my $ServiceContent = Vim::RetrieveServiceContent( _this => $ServiceInstance); # ... Login called next ... $ServiceContent->Login( _this => $ServiceContent->sessionManager, userName => $username, password => $password); In fact, if you look at the Login() function in VICommon.pm in the Perl SDK, you'll see that it does exactly the same process (with some other code to handle SDK versions and such).