WARNING on choice element

18 views
Skip to first unread message

jsonwebservice

unread,
Feb 14, 2011, 3:36:24 PM2/14/11
to jsonwebservice
In upcomming 0.6 version we are going to change the way of choice list
handling.

Root cause: when we have choice list object order not in proper order
added in server.

0.5 version test:

In : {"test1EmptyInXmlElementsOut":{}}";

expected : {"statusFlag":true,"xmlElementsObj":{"mapObject":
[{"keyProperty1":
1,"keyProperty2":"KK","property1":true,"valueProperty1":
2,"valueProperty2":"DD"}],
"objectReserved":[{"boolean":true,"enum":"CONST_2","float":
1.2,"int":1,"String":"SS"}],
"object":[{"property1":1},{"property1":2}]}}

In above example object with property1 added first and second but in
response it is moved last as well if there is another object mixed in
order, json format we are loosing order of choice element.

0.6 change:

{"statusFlag":true,"xmlElementsObj":
{"objectOrObjectReservedOrMapObject":[{"object":{"property1":1}},
{"object":{"property1":2}},{"objectReserved":
{"boolean":true,"enum":"CONST_2","float":1.2,"int":1,"String":"SS"}},
{"mapObject":{"keyProperty1":
1,"keyProperty2":"KK","property1":true,"valueProperty1":
2,"valueProperty2":"DD"}}]}}


Please get back if any one has difrent idea or consern about this
format.


jsonwebservice

unread,
Feb 14, 2011, 3:59:12 PM2/14/11
to jsonwebservice
In case of choice list with single object combinataion property
ignored. I,e list with only one Object result in json as

{"statusFlag":true,"xmlElementsObj":{"object":{"property1":1}}}

This is due to inconsistancy in finding choice with maxOcurences
greater than 1. When jaxb implement xml annotation with min and max
occurence,json codec handle it with proper json properties.

jsonwebservice

unread,
Feb 14, 2011, 4:51:02 PM2/14/11
to jsonwebservice
XML repeating sequence also affcted by this change.

NOT affected format example:
<xsd:sequence>
<xsd:element name="elm1" minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="elm2" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>

<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element name="elm1" />
</xsd:sequence>


Affected example sequence:

<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element name="elm1" />
<xsd:element name="elm2" />
</xsd:sequence>

On Feb 14, 9:36 pm, jsonwebservice <sundaramurt...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages