Consume complex web service

0
Hi, I want to consume a web service which is returning a nested json structure and want to display the data to the user. But when i am creating the json structure for that json data then it showing the following warning that “Array contains multiple JSON object definitions. Only first will be used. “ The json structure which i am getting is – [{     "person": {         "firstName": "Kaliki",         "lastName": "Mokshagna",         "orders": [{             "orderId": 1,             "orderNumber": 12345         }, {             "orderId": 2,             "orderNumber": 12346         }]     } }, {     "person": {         "firstName": "Ramanan",         "lastName": "Hariprasad",         "orders": [{             "orderId": 3,             "orderNumber": 12347         }]     } }, {     "person": {         "firstName": "Kaliki",         "lastName": "Madhavi",         "orders": []     } }, {     "person": {         "firstName": "Reddy",         "lastName": "Sridhar",         "orders": []     } }] So anyone can tell me the procedure of how to consume this web service data and how to display that data to the user. I want that all the data can be displayed to the user.    
asked
2 answers
2

This looks OK. You’re defining the mapping here, and since every object should be mapped in the same way, only one example is needed. It’s still an array and in the occurrence column you can see that you’re able to map zero to many objects. You can truncate the source json to get rid of the warning.

answered
0

Hi Prakar Jaiswal

Its seems problem with your JSON structure, We have already a posted question related to this.

https://forum.mendix.com/link/questions/89456 Try this.

Hope this will help!

answered