I have added a javascript policy in the response flow of a conditional flow in proxy endpoints. But this not being executed. The condition is returning false. However same condition returned true in the request flow.
This is soap to rest conversion proxy. Do i need to change the HTTP verbs in the response flow after target post flow is executed?
If the condition is returning false, its likely the request.verb is no longer set to GET so the policy does not execute in the response flow. If you’ve changed the Verb to POST while sending the payload to the target, this is most likely the case.
In order to execute the policy, you would need to save the request.verb in a flow variable say requestVerb for this flow and then use that variable in the condition in the response flow instead of the system variable request.verb.
Thanks @Hansel Miranda for your reply. Yes I changed the method type to POST for the soap target.I will change it back to GET. This is an additional steps for SOAP to REST conversion where the method type is GET. Can apigee make change to incorporate this additional step in WDSL import wizard? Just a thought.
@Krish , See the @Hansel Miranda answer below, That should solve your issue. Set a variable called “requestVerb” in request flow before you convert the verb to POST & then use the “requestVerb” custom variable instead of request.verb in your condition.
@Krish , Ideally yes, We encourage people to use the proxy editor instead of depending on the wizard. Actually, We use the local editor to develop proxies using xml instead of using the configuration UI. Developers loves coding
I would advise that you do not “change it back to GET”. Instead store the original verb in the preflow, then modify the Condition on the flow to test the stored condition.
@Krish If your javascript policy is in the Conditional Flow, you don’t need to put the same condition in the , what if you remove the condition in that or remove request.verb=GET in the condition?