Java Call out Policy and JavaScript Policy

I am setting up a variable in Java Callout policy using messageContext.setVariable("name",value). In the same flow, I wrote Javascript to read the variable [context.getVariable(';name)] I set up in Java Call out, but unfortunately, I see the variable as null.

The above situation is happening in production where I can't use trace, but I set the log level to debug I don't see any error when Java call out executes but when JavaScript executes the value of that variable is null.

Can someone help me?

0 1 220
1 REPLY 1

yes, I don't know what to tell you.

Here's an example of a Java callout that sets a context variable.

https://github.com/DinoChiesa/ApigeeEdge-Nanotime

There's an example API Proxy bundle too. Just deploy it and you can see it work.

Maybe you could use this as an example, and then somehow diagnose what's going wrong with your situation.

The above situation is happening in production where I can't use trace,

Why can't you? If you cannot diagnose this in production, can you test it and reproduce it in non-production?

but I set the log level to debug I don't see any error when Java call out executes

I think if you are setting DEBUG on, then you should see MesageContext.setVariable() calls in the debug log. So you see one for the variable you expect to be set?