JSON Deserialization

  

Hi!

First off, I'm using Outsystems 9.1 (9.1.0.20).

Any way...

I have a JSON web service with a bunch of web methods.

One of them is defined like this:The input structure is defined as:

So, the "data" attribute is a record list of UnisemWipDataStructure.

Thing is, when I call the web service with JSON in the attachment, I get the following result:Cool, right? The platform correctly parsed the "header" and the "items".

Except it didn't, because the records in the data record list are empty:

Any ideas why?

The structures were created with the WSCreator tool, which uses the JSON to generate them, and I used the exact JSON in the attachment to do it.

Thanks!

Carlos

Solution

Hi Carlos.

Try using List as the datatype of the data attribute.

You are using Record List, which I think introduces an intermediate structure on your JSON, like this:

{
    ...
    "data": [
        {
            "UnisemWipDataStructure>": {
                "PIPInstanceId":"12ac0f7b-a982-4dce-81c1-7414f7d3a064",
                ...
            }
        }
    ]
}


Solution

Leonardo Fernandes wrote:

Hi Carlos.

Try using List as the datatype of the data attribute.

You are using Record List, which I think introduces an intermediate structure on your JSON, like this:

{
    ...
    "data": [
        {
            "UnisemWipDataStructure>": {
                "PIPInstanceId":"12ac0f7b-a982-4dce-81c1-7414f7d3a064",
                ...
            }
        }
    ]
}


Changing the data type from Record List to just List worked.   

Thanks!