Hello,
I'm migrating my API Proxies from APIGE Edge to APIGEE X / Hybrid and facing an issue about serializing / deserializing and constructing JSON objects & arrays. In fact, in the Edge version the package org.json was doing the job perfectly in JAR file but now after i had migrated to APIGEE X / Hybrid, i have this issue :
Failed to execute JavaCallout. org/json/JSONObject
I tried with another package : javax.json but still same isse :
Failed to execute JavaCallout. javax/json/Json
So i'm thinking that maybe the problem comes from this package and that it's not compatible with version of APIGEE X
@dchiesa1, dou you have any idea about this tricky issue ?
Regards,
May be package dependencies as stated below..I am not using ApigeeX but if you go thru the guidelines it should help.
Ref:
i'm thinking that maybe the problem comes from this package and that it's not compatible with version of APIGEE X
Yes. You are correct.
Please see this repo. It includes a class that will successfully deserialize from JSON to a Map, when used within an Apigee callout. Check the README for full details.
The other option, if you don't want to be constrained by this restriction, is to use an ExternalCallout, and host your Java code in CloudRun etc.