Error While retrieving JSON objects in javascript

Not applicable

When I am setting JSON object in one js and trying to retrieve the same JSON object in next javascript and trying to traverse the JSON object and fetch the object , I am getting below error

com.apigee.javascript.om.message.JSONWrapper@245d448b

This approach was working earlier but now it has stopped , so has there been any new change for javascript

Solved Solved
0 15 836
1 ACCEPTED SOLUTION

@Manisha.Rathore4 ,

Issue has been fixed for your org. Can you please verify same and let us know. Thank you.

View solution in original post

15 REPLIES 15

@Manisha.Rathore4 , I can able to reproduce same. I will keep you posted.

@Manisha.Rathore4,

Inconvenience is regretted. Seems like recent release disabled javascript object parsing capabilities in Javascript Policy. We will follow up with Engineering team and keep you posted with more details. Stay tuned..

Thanks @Anil Sagar for the response , Can you please provide an ETA for this as our developed and testing is blocked due to this issue.

@Manisha.Rathore4 , ETA we can able to provide you by early morning PDT.. We will keep you posted.

@Manisha.Rathore4 ,

Issue has been fixed for your org. Can you please verify same and let us know. Thank you.

Thanks , Yes issue has been resolved.

@Anil Sagar

I am also facing the same issue.Is there a work around the issue? or can you fix for my org as well?

@Nikhil Preeth , Please send the ORG details to asagar@apigee.com, If you are enterprise customer please raise a support ticket.

Not applicable

@Manisha.Rathore4 i wrote a sample test case. The change is only in whats displayed in trace screen. When you use the variable you should still get a valid json object.

The difference is trace is

old: [object Object]

new: com.apigee.javascript.om.message.JSONWrapper@xxxxxx

-----

However we will fix what you see in trace to a better string. Thanks for pointing this.

Thank you @sriki77 ,

Just to add what srikanth said, variables are accessible even though com.apigee string was displayed. For example,

Script 1 :

 var json = {name: "Anil"};
 context.setVariable("myName", json);

Script 2:

var newName = context.getVariable("myName");
context.setVariable("newName", newName.name);

It still works though com.apigee.javascript.om.message.JSONWrapper@xxxxxx string was displayed in trace..

1118-screen-shot-2015-09-09-at-35452-pm.png

Cheers,

Anil Sagar

@Anil Sagar

@srikanth We are again facing same issue again where in If I am trying to fetch the JSON object in a script , it is failing with same error that it cannot find that object.

It was working yesterday post roll-back of cloud update for our org

Even though yesterday we were getting com.apigee.javascript.om.message.JSONWrapper variable , today we are getting it as [objectObject].

Please let us know if we have raise a support ticket for this.

@Manisha.Rathore4 , As far as i know, It's just a trace display issue. Even if you see "com.apigee.javascript.om.message.JSONWrapper" , you should able to access object properties & methods. Please check my example above. @sriki77 FYI..

@Anil Sagar Yes , I can understand that part ,but now in trace I can see the Variable set as [ObjectObject] , instead of com.apigee.javascript.om.message.JSONWrapper . But the issue is when I am trying to traverse the JSON and fetch the object , I am getting that object cannot be retrieve from null , but when i can see that JSON has that object , as when I am doing a stringify of that JSON all values are existing.

This issue was resolved yesterday post roll back of the cloud update for our org, so I am not sure if an update was again done for our org

@Manisha.Rathore4 , We are working on same. We have identified issue which is causing same. We will keep you updated.