Hi Jyoti,
In APIC v5 or v10's v5 compatible gateways, the invoke policy will implicitly attempt to parse the response payload based on the response's content-type header and will fail the transaction if a parse error occurs. This is a backend issue where the response's content type header is not properly describing the payload it is returning. In APIC v10 native API Gateway, there is no implicit parsing of the response in the invoke policy. That is done explicitly in the assembly using a parse action, which if configured as "detect" it would parse based upon the payload, not on the response header, but if configured to use content type, it would fail in a similar fashion. There is no workaround for this in v5/v5c other that to have the backend properly return a proper content type.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Mon October 31, 2022 09:16 AM
From: Jyoti Yadav
Subject: Getting "Error attempting to read the urlopen response data" error while hitting endpoint URL from API connect
Hello kandula,
Content-Type of request payload is "text/plain", but Backend application responses us with conetnt-type application/xml.
How to accept different content-type response in API connect?
------------------------------
Jyoti Yadav
Original Message:
Sent: Mon October 31, 2022 06:11 AM
From: kandula nagababu
Subject: Getting "Error attempting to read the urlopen response data" error while hitting endpoint URL from API connect
Hi Jyoti,
When testing direct backend through postman getting same header content-type "application/XML" then change the API Consumes and Produce value to your expected values, if backend also able to modify modify the content-type header to "application/json".
if not getting through postman, use the parse function in gateway script to handle the response it can be any format.
------------------------------
kandula nagababu
Original Message:
Sent: Mon October 31, 2022 04:59 AM
From: Jyoti Yadav
Subject: Getting "Error attempting to read the urlopen response data" error while hitting endpoint URL from API connect
Hello Team,
We are getting "Error attempting to read the urlopen response data" while hitting backend (endpoint URL) from API connect.
When we hit it through system (postman application), we are getting successful response.But response payload content-type shows "application/XML" (in headers) and response payload format is JSON.
Can this issue be resolved at backend or can we resolve it in API connect.Please suggest on it.
Thank you.
------------------------------
Jyoti Yadav
------------------------------