You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Brook Richan <br...@sandlot.com> on 2003/12/06 01:41:18 UTC

minOccurs="0" gummed up sometime between 2003-11-5 and 2003-12-5

I just got the latest Axis code today and something has gummed up the
treatment of minOccurs="0".

I did a compare of the previous version of the axis code I had, which
was just 30 days old, and there is so much changed that it would take a
while to fish around to see what happened. Perhaps someone who has
changed the code in the last 30 days might know quicker.

Here is the problem:

The xsd has:
  <xsd:element name="orderhdr" type="xsd:int" minOccurs="0"/>

With old 2003-11-5 code, the data type generated for orderhdr was
"java.lang.Integer".
With new 2003-12-5 code, the data type generated for orderhdr is now
"int".

This means the serializer can't know whether to generate the element or
not, so it always gets generated. So, in its initialized state I get
serialized:
  <orderhdr>0</orderhdr>

This is not good.

With the 2003-11-5 code, no element was generated, as expected.

I can see two bug reports that are sort of related, talking about
nillable and minOccurs: 15566 and 20109. But both are still marked NEW,
with no history on them for several months.

So, anybody know what changed and how to go about fixing it?

btw: .NET deals with this issue the same way Axis was dealing with it
prior to whatever changed recently.