axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pangburn, Jesse" <Jesse.Pangb...@us.lawson.com>
Subject RE: axis2 1.4 serializes minOccurs="0" element even when set to null
Date Wed, 22 Sep 2010 02:16:12 GMT
Thanks for the reply!  I didn't think I have control over that as I have a POJO service, so
I just defined my service class in the services.xml file and then build the appropriate URL
+ ?wsdl and I get the WSDL back from Axis2.  How do I remove the nillable attribute when Axis
is the one generating the WSDL file?

Thanks,
Jesse

From: Stephen Hall [mailto:shall@starmountsystems.com]
Sent: Tuesday, September 21, 2010 6:05 PM
To: java-user@axis.apache.org
Subject: Re: axis2 1.4 serializes minOccurs="0" element even when set to null

Remove the nillable attribute.or set it to false. When it's set to true it means 'its okay
to populate this element with an xsi:nil="true"', which is unnecessary since minOccurs is
set to zero.
On Tue, Sep 21, 2010 at 6:20 PM, Pangburn, Jesse <Jesse.Pangburn@us.lawson.com<mailto:Jesse.Pangburn@us.lawson.com>>
wrote:
Hi,
I have a pojo service where the response object contains a lot of fields that show up like
this in the WSDL:
<xs:element minOccurs="0" name="comments" nillable="true" type="xs:string"/>

When I return the containing object with comments field set to null, I would expect not to
see it serialized but in the response XML I see:
<ax22:comments xsi:nil="true" />

This is really bloating the size of the response object because in some cases the majority
of the fields are null.  Since it's minOccurs="0", my understanding is that it's perfectly
legal for Axis2 to not return that element.  Is there a setting or something I can do to tell
Axis2 to make this optimization?

Thanks,
Jesse



Disclaimer: The information contained in this communication is confidential and only for the
use of the intended addressee(s).  If you have received this communication in error, any disclosure
or use of such information is strictly prohibited.  Please notify the sender immediately and
destroy all copies.  Thank you.



Mime
View raw message