SOAP Web Services with fractional date value fails with "Invalid date value '1495620131.336'. Out of valid range (0 to 2147483647)"

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

 

A SOAP web services call that includes a date value that is not a whole integer fails with an error message that indicates that the date value is out of range but it is not.

Example 1:

When the following attribute value pair is included in a createRequest web services call:

<string>call_back_date</string>
<string>'1493157600.0'</string>

the response returned is:

<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Invalid date value '1493157600.0'. Out of valid range (0 to 2147483647)</faultstring>
<faultactor/>
<detail>
<ErrorMessage>Invalid date value  '1493157600.0'. Out of valid range (0 to 2147483647)</ErrorMessage>
<ErrorCode>1000</ErrorCode>
</detail>
</soapenv:Fault>

Example 2:

For a number format which uses "," as the separator between the integer value and the fractional value for the locale, such as in the following pair:

<string>call_back_date</string>
<string>1496275200,336</string>

the response returned in <faultstring> is:

"Invalid date value '1496275200,336'. Out of valid range (0 to 2147483647)"

Environment:
CA Service Desk Manager 14.1.03 and 17.0
Resolution:

Drop the fractional part of the date before providing it as the value of a date in a web services call.

 

The correction to Example 1 would be to strip off ".0" and only provide "1493157600" as the date value, as shown here:

<string>call_back_date</string>
<string>'1493157600'</string>

The correction to Example 2 would be to strip off ",336" and only provide "1496275200" as the date value, as shown here:

<string>call_back_date</string>
<string>1496275200</string>

Additional Information:

The Date data type is defined as an integer, which is a whole number.  For more information, please see: Definition of the Date data type