Hello,
Is there any object of JSON, I can use in Dynamics AX (2009).
Need example doing that, please.
Thanks :)
*This post is locked for comments
Hi Experts
We are trying to integrate external application with AX 2012. The provided API format is JSON we are able to connect API for login method and get response. If we try to access any other method we are getting error because we are not able to call the login method and the consecutive method in the same request sessions in AX. Can anyone guide us to understand how we can handle JSON session within AX also please guide us to understand serialize and de-serialize JSON .
Thanks for advance!!!!
I deserialize using the RetailCommonWebAPI .....but I check for value in each conpeek before trying to use it.....I noticed in the client that it just showed blank while the batch mode it failed.....not sure why
Hi Neetu,
I believed someone in my organization wrote their own version to de-serialize the Josn string. I wasn't involve with that process. Sorry I couldn't be much help.
Hi Tlim,
I am also facing same error in batch mode in side RetailCommonWebAPI call.
in non-batch mode, it works fine..
during batch mode processing got above mentioned error.
gave CLRobject assert permission too. yet same error during batch mode.
how did you resolved your issue. kindly share .
Thanks
Neetu
My json string is pretty simple {"CompanyId":"001","TransactionType":"100","Ranch":"200004","ItemId":"000000005","Qty":"2"}. What I found was that it is crashing at this statement:
deserializedCollection = new System.Collections.Hashtable(_dict);
in getMap Method with this error:
get_InnerException System.InvalidCastException: Object must implement IConvertible. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Dynamics.Ax.Application.RetailCommonWebAPI.getMap(Object _dict) in RetailCommonWebAPI.getMap.xpp:line 11 at Dynamics.Ax.Application.RetailCommonWebAPI.getMapFromJsonString(String _jsonString) in RetailCommonWebAPI.getMapFromJsonString.xpp:line 25 at Dynamics.Ax.Application.drscl_JSONStagi
It worked fine when running it in the AOT Job but it is crashing when running IT in the batch or calling it from a WCF Custom Service.
Tlim
What was the structure of the JSON that you were trying to return? Was there any binary or other strange data types in it? The RetailCommonWebAPI is customisable so you could for certain elements choose to not deserialise them
Hi Eitan, I was trying to use RetailCommonWebAPI to deserialize json but getting "Must implement IConvertible" error. So now, I'm looking at alternatives. Can you share how you developed your own JSON deserializer? Thanks.
Sorry Yasir - I will send you some private message.
Good luck.
That's was long time ago I opened this thread.
There were many things work not properly for this dlls (I have checked that), because json presume being binary, while there is try to set it as string (and like C#, it has some extra characters for specials .... such as // - json shall add /unnnn for special characters.
There are lot of problems, not mentioned, and since I need also pure "REST" for json (not that encapsulated by some xml), I did parsing myself, by supporting query+datacontract (for ax 2012), but I don't think I deal with json for ax 2009.
This is closed issue.
Thanks, anyway :)
Hi Eitan,
Were you able to use JSON in AX2009. I know we have NewtonSoft DLLs that we can use to parse the JSON data in AX. However, I am looking for some native solution. Were you able to find any?
Yasir
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Syed Haris Shah 9
Martin Dráb 2 Most Valuable Professional
Community Member 2