Error using axl RisPort

Unanswered Question
Oct 2nd, 2007

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!

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Mike-1985 Wed, 10/03/2007 - 02:29

Try using this as filter:

CmSelectionCriteria filter = new CmSelectionCriteria();

filter.MaxReturnedDevices = uint.MaxValue;

filter.Class = "Phone";

filter.Model = 255; //any model

filter.SelectBy = "Name";

paulogentile Wed, 10/03/2007 - 03:50

Hi, thanks for you response!

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

Mike-1985 Wed, 10/03/2007 - 04:00

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;

}

}

paulogentile Wed, 10/03/2007 - 06:42

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?

Actions

This Discussion