XFire

null values as request parameters

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.4
  • Fix Version/s: 1.2.5
  • Component/s: Aegis Module
  • Labels:
    None
  • Environment:
    jdk1.6.0 jax2b
  • Number of attachments :
    0

Description

Line 217 in org.codehaus.xfire.aegisAegisBindingprovider.java seems quirky to me, it causes an Exception with null value complex type parameters.

Caused by: javax.xml.stream.XMLStreamException: Attribute not associated with any element
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:600)
at org.codehaus.xfire.aegis.stax.AttributeWriter.writeValue(AttributeWriter.java:45)
... 36 more

The exeption is right, there is no open tag at this context.

A possible fix could be

213 MessageWriter mw = new ElementWriter(writer);
214
215 /* if (type.isNillable() && value == null)
216 { 217 mw.writeXsiNil(); 218 return; 219 } */
220
221 context.setProperty(CURRENT_MESSAGE_PART, p);

commented block should be removed.

Null value parameters are working after that patch.

Fixed request parameter output as sample:
<ns5:ArrayOfSortOption_3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns5="http://types.xlocate.xserver.ptvag.com" xmlns:ns4="http://wrappertypes.service.jabba.ptvag.com" xmlns:ns3="http://exception.core.jabba.ptvag.com" xmlns:ns2="http://common.xserver.ptvag.com" xmlns="http://xlocate.xserver.ptvag.com" xsi:nil="true"></ns5:ArrayOfSortOption_3>

Activity

Hide
Dan Diephouse added a comment -

Thanks Jens. Scheduling for 1.2.5

Show
Dan Diephouse added a comment - Thanks Jens. Scheduling for 1.2.5
Hide
Dan Diephouse added a comment -

Hi Jens, Are you using JAXB or another databinding? I think the correct fix is probably this instead:

if (type.isNillable() && type.isWriteOuter() && value == null)

Show
Dan Diephouse added a comment - Hi Jens, Are you using JAXB or another databinding? I think the correct fix is probably this instead: if (type.isNillable() && type.isWriteOuter() && value == null)
Hide
Dan Diephouse added a comment -

I applied the aforementioned fix in SVN. Let me know if that fixes things! Thanks!

Show
Dan Diephouse added a comment - I applied the aforementioned fix in SVN. Let me know if that fixes things! Thanks!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: