i added a web reference from https://myCMserver:8443/realtimeservice/services/RisPort?WSDL,and i use the method of
SelectCmDeviceResult SelectCmDevice(ref string StateInfo, CmSelectionCriteria CmSelectionCriteria) to get CMDevice list,but the response of SelectCmDeviceResult.CmNodes always is null,so i can't get any realtime information. what's wrong with my code.
there is my source code:
--------------------------------------
CM5WebReference.RISService myRis = new CM5WebReference.RISService();
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);
CM5WebReference.CmSelectionCriteria csc = new CM5WebReference.CmSelectionCriteria();
myRis.Credentials = new NetworkCredential("CCMAdministrator", "passwrod");
ServicePointManager.Expect100Continue = false;
myRis.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
CM5WebReference.CmSelectionCriteria cmSelection = new CM5WebReference.CmSelectionCriteria();
string stateInfo = ""; //is null? or....
csc.Class = "Any";
csc.Status = "Any";
csc.SelectBy = "Name";
CM5WebReference.SelectItem selectit = new CM5WebReference.SelectItem();
selectit.Item = "IP";
CM5WebReference.SelectItem si = new CM5WebReference.SelectItem();
si.Item = "Name";
CM5WebReference.SelectItem[] sis = new CM5WebReference.SelectItem[2] { selectit,si };
csc.SelectItems = sis;
CM5WebReference.SelectCmDeviceResult a = myRis.SelectCmDevice(ref stateInfo, csc);
cmselectCri.SelectBy = "Name";
cmselectCri.Class = "Any";
if (a.CmNodes != null) //always null,it's so strange...
{
CM5WebReference.CmNode[] cn = a.CmNodes;
CM5WebReference.CmDevice[] cd = cn[0].CmDevices;
string ip = cd[0].IpAddress;
}
thanks a lot.
my entironment:
CM 5.0.4.1000-1
vs2005(C#)