why invoke rest api activity failed with error, 'unable to deserialize response to json due to error: [EOF]'?
book
Article ID: KB0075669
calendar_today
Updated On:
Description
There will be a scenario where you need to use the invoke rest api activity to call the external or internal rest API's in your implementation. The rest invoke activity absorbs defined content and delivers the content of type app/json, text/plain & other (for other content types).
Error Stacktrace:
+++
2020-Mar-23 17:20:45:769 ERROR [flogo.flow] - Error evaluating activity 'InvokerestAPI'[git.tibco.com/git/product/ipaas/wi-contrib.git/contributions/General/activity/rest] - unable to deserialize response to json due to error: [EOF]
.
.
2020-Mar-23 17:20:45:769 ERROR [flogo.activity.rest] - Execution failed for Activity[InvokerestAPI] in Flow[xxx-xx] - unable to deserialize response to json due to error: [EOF]
+++
This error traces occurs when your invoke activity is configured for incorrect content-type in the output editor section.
Usually, it happens when you're calling 'GET' or 'DELETE' operation which does not return anything in the body section apart from HTTP status code and your activity is expecting data, configured with 'app/json' or 'text/plain'.
Issue/Introduction
There will be a scenario where you need to use the invoke rest api activity to call the external or internal rest API's in your implementation. The rest invoke activity absorbs defined content and delivers the content of type app/json, text/plain & other (for other content types).
Resolution
Troubleshooting approach:
To troubleshoot such issues, you can prefer to use other rest clients (Ex. soapui/postman, etc.) to verify the service behavior/outcome. Then you can compare the configuration between the invoke activity & the other rest clients and adjust your configuration accordingly if other client works perfectly.
If other clients too facing the same problem then it might be a problem with the service that your accessing.
Solution:
If there no problem with service, then this must be a configuration issue in the invoke activity.
You can change the content-type in the output of activity to 'others', this will allow the activity to incorporate the status code only and ignore the missing body part (here, the body is not missing rather it is how your service is designed and incorrect configuration of the client).
With this change, you can successfully call the service operation which only returns the status code.
Feedback
thumb_up
Yes
thumb_down
No