示例#1
0
 public static string getCIMSessionId(Vim25Api.ManagedObjectReference hmor1, String[] args, Cookie cookie)
 {
     AppUtil.AppUtil ecb = null;
     try
     {
         ecb = AppUtil.AppUtil.initialize("GetCIMSessioId"
                                          , args);
         ecb.connect(cookie);
         _service = ecb.getConnection()._service;
         _sic     = ecb.getConnection().ServiceContent;
         ManagedObjectReference hmor = VersionUtil.convertManagedObjectReference(hmor1);
         string sessionId            = _service.AcquireCimServicesTicket(hmor).sessionId;
         return(sessionId);
     }
     catch (Exception e)
     {
         ecb.log.LogLine("Get GetSessionID : Failed Connect");
         throw e;
     }
     finally
     {
         ecb.log.LogLine("Ended GetSessionID");
         ecb.log.Close();
     }
 }
示例#2
0
 public static string getCIMSessionId (Vim25Api.ManagedObjectReference hmor1, String[] args, Cookie cookie)
 {
     AppUtil.AppUtil ecb = null;
     try
     {
         ecb = AppUtil.AppUtil.initialize("GetCIMSessioId"
                                          , args);
         ecb.connect(cookie);
         _service = ecb.getConnection()._service;
         _sic = ecb.getConnection().ServiceContent;
         ManagedObjectReference hmor = VersionUtil.convertManagedObjectReference(hmor1);
         string sessionId = _service.AcquireCimServicesTicket(hmor).sessionId;
         return sessionId;
     }
     catch (Exception e)
     {
         ecb.log.LogLine("Get GetSessionID : Failed Connect");
         throw e;
     }
     finally
     {
         ecb.log.LogLine("Ended GetSessionID");
         ecb.log.Close();
     }
 }