« Back to Serviceability XML Questions

SelectCmDevice not returning any device in 8.0

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi all, I'm trying to make a query to the SelectCmDevice method, to get all the phones in the CM, but I don't receive any information. The query succeeds, but I get zero devices returned. I think the web service call is ok, and I tried with the same code generated to call GetServerInfo and is working fine. Any ideas?? Here is the C# code I'm using and the generated xml request:
 
            CmSelectionCriteria mySel = new CmSelectionCriteria();
            mySel.Model = 255;
            mySel.Class = "Any";
            mySel.SelectBy = "Name";
            mySel.MaxReturnedDevices = 100;
            mySel.Status = "Any";
            string sStatus = "Any";

                      
            SelectCmDeviceResult res = myRis.SelectCmDevice(ref sStatus, mySel);
 
 
Here is the SOAP Request generated:
 

    <soap:Envelope
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:tns="http://schemas.cisco.com/ast/soap/"
        xmlns:types="http://schemas.cisco.com/ast/soap/encodedTypes"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <soap:Body
            soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <tns:SelectCmDevice>
                <StateInfo
                    xsi:type="xsd:string">
                    Any
                    </StateInfo>
                <CmSelectionCriteria
                    href="#id1"/>
                </tns:SelectCmDevice>
            <tns:CmSelectionCriteria
                id="id1"
                xsi:type="tns:CmSelectionCriteria">
                <MaxReturnedDevices
                    xsi:type="xsd:unsignedInt">
                    100
                    </MaxReturnedDevices>
                <Class
                    xsi:type="xsd:string">
                    Any
                    </Class>
                <Model
                    xsi:type="xsd:unsignedInt">
                    255
                    </Model>
                <Status
                    xsi:type="xsd:string">
                    Any
                    </Status>
                <NodeName
                    xsi:nil="true"/>
                <SelectBy
                    xsi:type="xsd:string">
                    Name
                    </SelectBy>
                <SelectItems
                    xsi:nil="true"/>
                </tns:CmSelectionCriteria>
            </soap:Body>
        </soap:Envelope>

Finally solved the problem, the parameter StateInfo was wrong in the xml query, it should be empty.