You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Gal Rob <ga...@hotmail.com> on 2008/09/30 13:55:03 UTC

sending null in Object Array

Hi!
 
I'm sending Object[] to ws as one of the parameters. If Array members are Objects or primitive types everithing is OK. But if Object[] contains also nulls they will not get prop[agated to WS. Size of Array is decreased by number of null members in array. 
I'm quite new to WS so I'm not sure if this is part of JAX-WS specification or I'm doing something wrong.
 
Test code looks like this:
Object[] methodParameters = {"John", null};
NotificationService.sendNotify("TEST", methodParameters);
 
Thanks for help,
Robert
_________________________________________________________________
Jednoduchá kontrola zabezpečenia počítača.
http://onecare.live.com/site/sk-sk/

RE: sending null in Object Array

Posted by Gal Rob <ga...@hotmail.com>.
Thanks Dan.> From: dkulp@apache.org> To: users@cxf.apache.org> Subject: Re: sending null in Object Array> Date: Tue, 30 Sep 2008 17:22:46 -0400> CC: galrob74@hotmail.com> > > This is more or less per JAX-WS spec. The mapping for an array > parameter is just minOccurs=0/maxOccurs=unbounded. It doesn't put > nillable=true.> > The ONLY way to control this is to generate a wrapper bean and modify the > @XmlElement annotation to add the nillable=true thing. You can use > java2ws -wrapperbean to generate the initial versions. Then add a > @RequestWrapper annotation to your method to point at it.> > Dan> > > On Tuesday 30 September 2008, Gal Rob wrote:> > Hi!> >> > I'm sending Object[] to ws as one of the parameters. If Array members> > are Objects or primitive types everithing is OK. But if Object[]> > contains also nulls they will not get prop[agated to WS. Size of Array> > is decreased by number of null members in array. I'm quite new to WS> > so I'm not sure if this is part of JAX-WS specification or I'm doing> > something wrong.> >> > Test code looks like this:> > Object[] methodParameters = {"John", null};> > NotificationService.sendNotify("TEST", methodParameters);> >> > Thanks for help,> > Robert> > _________________________________________________________________> > Jednoduchá kontrola zabezpečenia počítača.> > http://onecare.live.com/site/sk-sk/> > > > -- > J. Daniel Kulp> Principal Engineer, IONA> dkulp@apache.org> http://www.dankulp.com/blog
_________________________________________________________________
Vytvorte si svoj web pre komunikáciu s priateľmi. Je to naozaj jednoduché.
http://home.services.spaces.live.com/?mkt=sk-sk

Re: sending null in Object Array

Posted by Daniel Kulp <dk...@apache.org>.
This is more or less per JAX-WS spec.   The mapping for an array 
parameter is just minOccurs=0/maxOccurs=unbounded.   It doesn't put 
nillable=true.

The ONLY way to control this is to generate a wrapper bean and modify the 
@XmlElement annotation to add the nillable=true thing.   You can use 
java2ws -wrapperbean to generate the initial versions.    Then add a 
@RequestWrapper annotation to your method to point at it.

Dan


On Tuesday 30 September 2008, Gal Rob wrote:
> Hi!
>
> I'm sending Object[] to ws as one of the parameters. If Array members
> are Objects or primitive types everithing is OK. But if Object[]
> contains also nulls they will not get prop[agated to WS. Size of Array
> is decreased by number of null members in array. I'm quite new to WS
> so I'm not sure if this is part of JAX-WS specification or I'm doing
> something wrong.
>
> Test code looks like this:
> Object[] methodParameters = {"John", null};
> NotificationService.sendNotify("TEST", methodParameters);
>
> Thanks for help,
> Robert
> _________________________________________________________________
> Jednoduchá kontrola zabezpečenia počítača.
> http://onecare.live.com/site/sk-sk/



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog