The CA Service Desk Manager (CA SDM) SOAP Web Services method doQuery only returns 250 rows. Can this be extended?

Document ID : KB000009402
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

There is a limitation with the CA SDM Web Services method doQuery, that it will only return 250 rows. This is documented in the Technical Reference Guide for each CA SDM release.

 

This document describes another method that should be used to go beyond the 250 row limitation.

Instructions:

There is a different method that can be used via CA SDM Web Services called: "doSelect()".

The examples below show the XML representation of the SOAP Web Services calls.

The method "doSelect()" will return a "list handle".

The "listHandle" can be passed to another call - "getListValues()".

This method takes a start index and end index argument.

This will allow to retrieve 250 rows at a time. However, it is possible to retrieve the next 250 rows and so on, until the entire list is retrieved.

For example, below we make a call to doSelect():

 

 	<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" x
    mlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
     <soapenv:Header/>
       <soapenv:Body>
        <ser:doQuery>
         <sid>163624873</sid>
         <objectType>cnt</objectType>
       <whereClause>last_name IS NOT NULL</whereClause>
      </ser:doQuery>
     </soapenv:Body>
    </soapenv:Envelope> 

 

This produces a very large list as shown below:

 

 	 <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>
        <doQueryResponse xmlns="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
         <doQueryReturn xmlns="">
          <listHandle>-1610501534</listHandle>
          <listLength>13798</listLength>
         </doQueryReturn>
        </doQueryResponse>
      </soapenv:Body>
     </soapenv:Envelope> 

 

Here, we can see there are 13798 rows returned.

We can then call getListValues and pass a startIndex and endIndex to retrieve groups of results at a time.

For example: 

 	 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" x
     mlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
      <soapenv:Header/>
       <soapenv:Body>
        <ser:getListValues>
         <sid>163624873</sid>
          <listHandle>-1610501534</listHandle>
          <startIndex>251</startIndex>
          <endIndex>500</endIndex>
          <attributeNames>
          <!--1 or more repetitions:-->
          <string>last_name</string>
         </attributeNames>
        </ser:getListValues>
       </soapenv:Body>
      </soapenv:Envelope> 


You can continue to retrieve the rest of the list in '"chunks".

Using "doSelect()" and the procedure above is the appropriate method to pull back data when we want to go past the 250 count limit.

One important note, it is important to also call freeListHandles when done to flush the list from memory on the server to avoid memory growth.

Additional Information: