cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
753
Views
0
Helpful
4
Replies

Error using axl RisPort

paulogentile
Level 1
Level 1

Hi, i'm trying to get the device ip using the risport... so i use the wsdl to make a webreference in VS2005 c# ... here is my code...

CiscoRis.DeviceQueryService ris = new CiscoRis.DeviceQueryService();

ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);

ris.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;

ServicePointManager.Expect100Continue = false;

ris.Credentials = new NetworkCredential("Administrator", "pass");

ris.Url = "https://CMIP:8443/realtimeservice/services/RisPort";

CmSelectionCriteria filter = new CmSelectionCriteria();

filter.MaxReturnedDevices = uint.MaxValue;

filter.Class = DeviceClass.Phone;

filter.Model = 255; //any model

string stateInfo = null; //execution summary

SelectCmDeviceResult result = ris.SelectCmDevice(ref stateInfo, filter);

CmNode[] nodes = result.CmNodes;

CmDevice[] devices = nodes[0].CmDevices;

foreach (CmDevice device in devices)

{

Response.Write(device.IpAddress + Environment.NewLine);

Response.Write("");

}

but when i execute i'm get this error:

java.lang.IllegalArgumentException: argument type mismatch

If someone know why i'm having this problem please let me know... Thanks!

4 Replies 4

Mike-1985
Level 1
Level 1

Try using this as filter:

CmSelectionCriteria filter = new CmSelectionCriteria();

filter.MaxReturnedDevices = uint.MaxValue;

filter.Class = "Phone";

filter.Model = 255; //any model

filter.SelectBy = "Name";

Hi, thanks for you response!

I try to change but the error still the same...

hmmm... this is the full code I use:

ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();

ServicePointManager.Expect100Continue = false;

RISService ris = new RISService();

ris.Credentials = new NetworkCredential(ccmAdmin, ccmPass);

ris.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;

ris.Url = "https://" + ccmIp + ":8443/realtimeservice/services/RisPort";

CmSelectionCriteria filter = new CmSelectionCriteria();

filter.MaxReturnedDevices = uint.MaxValue;

filter.Class = "Phone";

filter.Model = 255; //any model

filter.SelectBy = "Name";

string stateInfo = null; //execution summary

SelectCmDeviceResult tmpResult = ris.SelectCmDevice(ref stateInfo, filter);

public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy

{

public TrustAllCertificatePolicy() { }

public bool CheckValidationResult(ServicePoint sp,

X509Certificate cert,

WebRequest req,

int problem)

{

return true;

}

}

I try to use your code but i coundn't i this was because my webreference was made in a CM 4.2.. because when i try to make a webreference in a CM 5.1 i get this error..

There was an error downloading 'https://172.16.200.202:8443/realtimeservice/services/RisPort?WSDL'.

The underlying connection was closed: An unexpected error occurred on a receive.

m_safeCertContext is an invalid handle.

there is a chance to you send to me an empty project only with the webreference?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: