public ServiceInstance(URL url, String username, String password, boolean ignoreCert, String namespace)
throws RemoteException, MalformedURLException
{
if(url == null || username==null)
{
throw new NullPointerException("None of url, username can be null.");
}
setMOR(SERVICE_INSTANCE_MOR);
VimPortType vimService = new VimPortType(url.toString(), ignoreCert);
vimService.getWsc().setVimNameSpace(namespace);
serviceContent = vimService.retrieveServiceContent(SERVICE_INSTANCE_MOR);
vimService.getWsc().setSoapActionOnApiVersion(serviceContent.getAbout().getApiVersion());
serviceContent = vimService.retrieveServiceContent(SERVICE_INSTANCE_MOR);
setServerConnection(new ServerConnection(url, vimService, this));
UserSession userSession = getSessionManager().login(username, password, null);
getServerConnection().setUserSession(userSession);
}