Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Error using axl RisPort

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
New Member

Re: Error using axl RisPort

Try using this as filter:

CmSelectionCriteria filter = new CmSelectionCriteria();

filter.MaxReturnedDevices = uint.MaxValue;

filter.Class = "Phone";

filter.Model = 255; //any model

filter.SelectBy = "Name";

New Member

Re: Error using axl RisPort

Hi, thanks for you response!

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

New Member

Re: Error using axl RisPort

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;

}

}

New Member

Re: Error using axl RisPort

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?

460
Views
0
Helpful
4
Replies