Getting"Invalid aggregation type specified" exception when calling CEM Web services API

Document ID : KB000008227
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Following exception was returned when I am trying to use the the getAggregatedBusinessProcessStats CEM Web services API in SoapUI:

 

<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>
      <soapenv:Fault>
         <faultcode>soapenv:Server.userException</faultcode>
            <faultstring>com.timestock.tess.webservices.api.CEMWebServicesException: Invalid aggregation type specified.</faultstring>
                  <detail>
                           <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">cdcapm6j</ns1:hostname>
                  </detail>
     </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

 

The input values were:

 <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.webservices.tess.timestock.com">
   <soapenv:Header/>
      <soapenv:Body>
         <impl:getAggregatedBusinessProcessStats soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <businessProcessDefinitionId xsi:type="xsd:long">700000000000000016</businessProcessDefinitionId>
            <interval xsi:type="urn:TimeDuration" xmlns:urn="urn:ca.wily.cem.webservices">
               <aggregationInterval xsi:type="xsd:int">50</aggregationInterval>
               <endTime xsi:type="xsd:dateTime">2017-09-15T09:00:00-05:00</endTime>
               <startEndOnSameDayMonthYear xsi:type="xsd:boolean">True</startEndOnSameDayMonthYear>
               <startTime xsi:type="xsd:dateTime">2017-09-15T10:00:00-05:00</startTime>
            </interval>
      </impl:getAggregatedBusinessProcessStats>
   </soapenv:Body>
</soapenv:Envelope>

Environment:
CEM Web Services API in SoapUI 5.3
Cause:

The error indicates that one of the parameter values provided was invalid.

In this case, the aggregationInterval value of "50" was causing the error.

According to the Statistics Command Paramaters and Syntax section in the CA APM documentation, the valid values are:

1 - Hourly
2 - Daily
3 - Weekly
4 - Monthly.


Resolution:

Replacing the correct value for the aggregationInterval parameter resolved the error.

For example, below are the valid inputs for this API:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.webservices.tess.timestock.com">
   <soapenv:Header/>
      <soapenv:Body>
         <impl:getAggregatedBusinessProcessStats soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <businessProcessDefinitionId xsi:type="xsd:long">700000000000000016</businessProcessDefinitionId>
            <interval xsi:type="urn:TimeDuration" xmlns:urn="urn:ca.wily.cem.webservices">
               <aggregationInterval xsi:type="xsd:int">4</aggregationInterval>
               <endTime xsi:type="xsd:dateTime">2017-09-15T09:00:00-05:00</endTime>
               <startEndOnSameDayMonthYear xsi:type="xsd:boolean">True</startEndOnSameDayMonthYear>
               <startTime xsi:type="xsd:dateTime">2017-09-15T10:00:00-05:00</startTime>
            </interval>
      </impl:getAggregatedBusinessProcessStats>
   </soapenv:Body>
</soapenv:Envelope>