cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
229
Views
0
Helpful
0
Replies
Highlighted
Beginner

Access to RisPort70 from c# .net

I'm trying to call SelectCMDevice from RisPort70 from c#.

My c# code to call SelectCmDevice

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
ServicePointManager.Expect100Continue = false;

RISService70 client = new RISService70();
System.Net.ICredentials cred = new NetworkCredential("xxxxxxxxxxx", "xxxxxxxxxxxxxx");
client.Credentials = cred;
client.PreAuthenticate = true;
string StateInfo = "";
CmSelectionCriteria criteria = new CmSelectionCriteria();
criteria.MaxReturnedDevices = 5;
criteria.Class = "Any";
criteria.Model = 255;
criteria.Status = "Any";
criteria.NodeName = "";
criteria.SelectBy = CmSelectBy.Name;

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(@"<body xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<item xsi:type='xsd:item'><Item xsi:type=""xsd:string"">*</Item></item>
</body>");
var test = doc.GetElementsByTagName("item");
var listOfNodes = new List<System.Xml.XmlElement>(test.Cast<System.Xml.XmlElement>());
criteria.SelectItems = new SelectItems();
criteria.SelectItems.Any = listOfNodes.ToArray();
criteria.SelectItems.arrayType = "ris:item[1]";
criteria.SelectItems.offsetSpecified = false;
criteria.SelectItems.id = "";

SelectCmDeviceResult res = client.SelectCmDevice(ref StateInfo, criteria);

My request looks like this (raw data grabbed from fiddler)

https://10.56.132.3:8443/realtimeservice/services/RisPort70 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000)
VsDebuggerCausalityData: uIDPo6fxinS+AK1Bv8AFfkn+tVwAAAAA0JZNy1hYO0+M8VpQKhpBZNC/JwWkUZdBtodo6m1DflUACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Host: 10.56.132.3:8443
Content-Length: 1343

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <SelectCmDevice xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">
            <StateInfo xmlns="" />
            <CmSelectionCriteria xmlns="">
                <MaxReturnedDevices xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">5</MaxReturnedDevices>
                <Class xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">Any</Class>
                <Model xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">255</Model>
                <Status xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">Any</Status>
                <NodeName xmlns="http://ccm.cisco.com/serviceability/soap/risport70/" />
                <SelectBy xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">Name</SelectBy>
                <SelectItems d5p1:arrayType="ris:item[1]" id="" xmlns:d5p1="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://ccm.cisco.com/serviceability/soap/risport70/">
                    <item xsi:type="xsd:item" xmlns="">
                        <Item xsi:type="xsd:string">*</Item>
                    </item>
                </SelectItems>
                <Protocol xsi:nil="true" xmlns="http://ccm.cisco.com/serviceability/soap/risport70/" />
                <DownloadStatus xsi:nil="true" xmlns="http://ccm.cisco.com/serviceability/soap/risport70/" />
            </CmSelectionCriteria>
        </SelectCmDevice>
    </soap:Body>
</soap:Envelope>

 

I'm getting something back (raw data grabbed from Fiddler)

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <soapenv:Body>

        <ns1:SelectCmDeviceResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://ccm.cisco.com/serviceability/soap/risport70/">

            <SelectCmDeviceResult xsi:type="ns1:SelectCmDeviceResult">

                <TotalDevicesFound xsi:type="xsd:unsignedInt">5</TotalDevicesFound>

                <CmNodes soapenc:arrayType="ns1:CmNode[4]" xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

                    <item xsi:type="ns1:CmNode">

                        <ReturnCode xsi:type="ns1:RisReturnCode">NotFound</ReturnCode>

                        <Name xsi:type="xsd:string">twdlimp001.nb.com</Name>

                        <NoChange xsi:type="xsd:boolean">true</NoChange>

                        <CmDevices xsi:type="ns1:CmDevice" xsi:nil="true"/>

                    </item>

                    <item xsi:type="ns1:CmNode">

                        <ReturnCode xsi:type="ns1:RisReturnCode">NotFound</ReturnCode>

                        <Name xsi:type="xsd:string">twdlimp002.nb.com</Name>

                        <NoChange xsi:type="xsd:boolean">true</NoChange>

                        <CmDevices xsi:type="ns1:CmDevice" xsi:nil="true"/>

                    </item>

..............................

However res doesn't contain any data

SelectCmDeviceResult res = client.SelectCmDevice(ref StateInfo, criteria);

Any idea how to call RisPort70 from .net?

Everyone's tags (3)
This widget could not be displayed.