You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Maxime Orain <Ma...@thomsonreuters.com> on 2008/10/10 19:01:09 UTC

XSI:NIL & Nillable

Hello!

 

Last questions for the day!

 

Why when I send xsi:nil = 'true' CXF understand that like an Empty
object?

 

Is it because my service parameter isn't set to nillable=true?

 

If it's that how can I set my service parameter to nillable = true? 

(it's working for pojo with setting the @XMLElement but I didn't find
the same for method parameter)

 

Thanks for your help!

 

Maxime.

 



This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.


Re: XSI:NIL & Nillable

Posted by Daniel Kulp <dk...@apache.org>.
On Friday 10 October 2008 1:01:09 pm Maxime Orain wrote:
> Hello!
>
>
>
> Last questions for the day!
>
> Why when I send xsi:nil = 'true' CXF understand that like an Empty
> object?
>
> Is it because my service parameter isn't set to nillable=true?

Most likely yes.   If it's not nillable, I don't think JAXB bothers to check 
for the xsi:nil attribute as it wouldn't be valid.

> If it's that how can I set my service parameter to nillable = true?
> (it's working for pojo with setting the @XMLElement but I didn't find
> the same for method parameter)

The ONLY way to do this with JAXB is to generate wrapper types and edit the 
wrapper types to put the nillable="true" attribute on the @XmlElement 
annotations.  You can use the "java2ws -wrapperbean foo.bar.className" tool 
to generate initial versions of the beans.  

Dan


>
>
>
> Thanks for your help!
>
>
>
> Maxime.
>
>
>
>
>
> This email was sent to you by Thomson Reuters, the global news and
> information company. Any views expressed in this message are those of the
> individual sender, except where the sender specifically states them to be
> the views of Thomson Reuters.



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog