Print this page

Web service callout cannot parse empty values for some data types in the Web service response, i.e. Integer, DateTime

Knowledge Article Number 000212237
Description When invoking a web service callout, why do we hit the following callout exceptions?

System.CalloutException: Web service callout failed: Failed to deserialize value '', due to:Unable to parse dateTime

OR

System.CalloutException: Web service callout failed: Failed to deserialize value '', due to:Unable to parse Integer
Resolution The callout exceptions are thrown because a web service callout cannot parse empty values for some data types in the web service response, i.e. Integer or DateTime.

These exceptions may be avoided as follows:

1. Modify endpoint service, to send back valid Integer or DateTime values in response
2. Modify the WSDL2Apex class, changing the data type of impacted field to String
3. Create another WSDL2Apex method which only takes required fields, avoiding the use of empty values for those Integer or DateTime fields




promote demote