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 <
[email protected]> 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.

Reply via email to