Original Message:
Sent: Fri May 05, 2023 08:50 AM
From: Steve Linn
Subject: Error Attempting to read the url open response data
Hi Fahad,
I'm assuming by the error that you are sending your request to the backend using an invoke version 1.5.0 policy. The 1.5.0 policy uses multiple native 2.0.0 policies under the covers in order to behaves as the v5 invoke did for compatibility. Part of that compatibility is to parse the backend response. This policy uses a parse settings object named apic-default-parsesettings which has default values of a max document size of 4194304 bytes and what you may be running into, a maximum value length of 8192 bytes which your base64 large value string is most probably exceeding. You should see a parse error in your DataPower logs. To resolve this, you will need to override the values in this object using a Gateway Extension. Given you've migrated from v5 to v10 and are using a 1.5.0 policy, you should already have a Gateway Extension in place. You'll need to add a configuration zip to this gateway-extension.zip file, and then update the gateway-extension.zip file's manifest.json file to reference it. I've done the same in my own test environment. I create a file named apic-default-parsesettings.cfg that has the DataPower CLI commands to update this object.
top; configure terminalparse-settings apic-default-parsesettings document-size 8388608 value-length 8388608exit
Of course your values will need to be set based on your requirements. I then zipped the .cfg file, creating apic-default-parsesettings.zip that contained only this .cfg file and added that zip file to my gateway-extension.zip file. Then in the manifest.json file I added a reference to this zip file in the files array:
"files": [ { "filename": "apic-default-parsesettings.zip", "deploy": "immediate", "type": "extension" },... existing file references ]
See https://www.ibm.com/docs/en/api-connect/10.0.1.x?topic=gateway-extensions-manifest for information on the manifest.json file, and https://www.ibm.com/docs/en/api-connect/10.0.1.x?topic=behavior-gateway-extension-guidelines-datapower-api-gateway for general information on the API Gateway gateway extension.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Thu May 04, 2023 03:38 PM
From: Fahad Hassan
Subject: Error Attempting to read the url open response data
HI Steve,
Thanks for reply. we have just migrated from APIC v5 to v10. JSON Structure is coming from backend and payload is correct and also Content-Type is application/json as expected. However we see that if JSON key has base64 large string in those cases its giving this error.
BR
Fahad
------------------------------
Fahad Hassan
Original Message:
Sent: Thu May 04, 2023 11:28 AM
From: Steve Linn
Subject: Error Attempting to read the url open response data
Hi Fahad,
What type of Gateway are you using, v5 compatible or v10 API Gateway? v5c will return this if your backend is returning an incorrect content-type, for example, application/json when the payload is either malformed JSON or perhaps another data type such as XML. Do you have access to the DataPower logs associated with this failure?
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed May 03, 2023 05:02 AM
From: Fahad Hassan
Subject: Error Attempting to read the url open response data
HI Team,
I am facing subjected error while calling backend. I have checked response content type matches with payload that is being returned. I am using API Connect v10 calling backend in assembly. Can you please help me with this issue?
BR
Fahad
------------------------------
Fahad Hassan
------------------------------