API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Error Attempting to read the url open response data

    Posted Wed May 03, 2023 09:27 AM

    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
    ------------------------------


  • 2.  RE: Error Attempting to read the url open response data

    Posted Thu May 04, 2023 11:29 AM
    Edited by Steve Linn Thu May 04, 2023 12:15 PM

    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
    ------------------------------



  • 3.  RE: Error Attempting to read the url open response data

    Posted Thu May 04, 2023 03:39 PM

    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
    ------------------------------



  • 4.  RE: Error Attempting to read the url open response data

    Posted Fri May 05, 2023 08:51 AM

    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 terminal
    
    parse-settings apic-default-parsesettings
     document-size 8388608
     value-length 8388608
    exit

    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
    ------------------------------



  • 5.  RE: Error Attempting to read the url open response data

    Posted Fri May 05, 2023 11:35 AM

    HI Steve,

    Thanks for Reply. Will Surely implement this and will let you know.

    BR
    Fahad



    ------------------------------
    Fahad Hassan
    ------------------------------