Extract Variable JSONPath working in Test, but not in Prod

I'm trying to extract 3 variables from an incoming JSON structure using the following Extract Variable code:

<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <JSONPayload>
        <Variable name="siteId">
            <JSONPath>$.Facility</JSONPath>
        </Variable>
        <Variable name="moId">
            <JSONPath>$.ManufacturingOrderNumber</JSONPath>
        </Variable>
        <Variable name="m3Timestamp">
            <JSONPath>$.Timestamp</JSONPath>
        </Variable>
    </JSONPayload>
    <Source clearPayload="false">request</Source>
</ExtractVariables>

All three variables aren't nested within the JSON.

In our Dev and Test environment this is working as expected. But as soon as we deployed this to our Prod environment things got weird. As it won't extract any of the variables in this environment.

What we've already tried:

- See if there's a difference in environmental variables.

- Check test and prod environment traces to see if there's any difference.

- Use the same exact JSON files for both environments.

- Redeploy proxy/reload the policy.

Yet this hasn't fixed our issue yet. Any help will be appriciated!

Solved Solved
0 4 196
1 ACCEPTED SOLUTION

Not applicable

Can you try below things?

Remove ignoreunresolved tag

Remove source tag

Ensure the content type is application/json

View solution in original post

4 REPLIES 4

Not applicable

Can you try below things?

Remove ignoreunresolved tag

Remove source tag

Ensure the content type is application/json

I've tried them both and it seems to fix the issue.

I've also added a Javascript policy to check if it has extracted them correctly to be sure. So far so good, thank you for your help!

Not possible if you described is correct. There may be a difference for sure which you may not be looking at(possible code diff/payload diff etc which is hard to understand)..

Run a debug(https://docs.apigee.com/private-cloud/v4.18.05/enabling-debug-logging) on MP and see if you see e-e flow.
Isolate the flow and do a simple extract to validate..

Thank you for the suggestions!

We don't use private cloud, but with the help of Priyadarshi I've been able to fix the issue for now.