public NCentralMachineFacade(String serverUrl, String username, String password) { this.s = new ServerEIService(serverUrl + "/dms/services/ServerEI"); this.username = username; this.password = password; }
/// <summary> /// Fetches Device info from the N-Central server via its SOAP API /// </summary> /// <param name="applianceID"></param> /// <returns></returns> public DeviceInfo getDeviceInfo(String serverUrl, String username, String password, String applianceID) { if (applianceID == null || applianceID.Length == 0) { throw new Exception("Empty ApplianceID"); } ServerEIService s = new ServerEIService(serverUrl); T_KeyPair[] keyPairs = new T_KeyPair[1]; T_KeyPair deviceID = new T_KeyPair(); deviceID.Key = "applianceID"; deviceID.Value = applianceID; keyPairs[0] = deviceID; DeviceInfo[] results = null; DeviceInfo result = null; results = s.DeviceGet(username, password, keyPairs); if (results.Length == 0) { throw new Exception("N-Central API call to getDeviceInfo returned no results for Appliance ID " + applianceID); } result = results[0]; return result; }