Issues deserializing JSON Wrapper

0
Dear Mendix experts, I got stuck trying to transfer a REST API response into a list in my mendix application. The JSON structure of the repsonse looks as follows: { "message": [ "CAR_ID1", "CAR_ID2" ] } My problem is that Mendix does not recognize the cars as an array (pls. see screenshot of the Mendix JSN structure window below).  How to I list the cars in a carList in my application? Thanks a lot for your support! Jonas
asked
3 answers
3

Hi Jonas,

Unfortunately, Mendix does not have the concept of an array of strings. It only knows array of objects. So to consume this REST API you need to create a Wrapper/Helper entity with a string attribute and use this in the import mapping. 

Hope this helps,

answered
2

I dealt with something similar a while back. It was a WSDL but the concepts still apply, perhaps this can help you.

Blog Post about handling CData in a service

answered
0

Hi Andrej,

thanks for answering that fast.

Good to know that arrays of strings do not work per se in Mendix. Unfortunately, I never worked with wrapper entities before. Is there any example of how this would look like?

 

Thanks

answered