History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-845
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Diephouse
Reporter: Jens Lukas
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

null values as request parameters

Created: 17/Jan/07 03:37 AM   Updated: 13/Mar/07 01:54 PM
Component/s: Aegis Module
Affects Version/s: 1.2.4
Fix Version/s: 1.2.5

Time Tracking:
Not Specified

Environment: jdk1.6.0 jax2b


 Description  « Hide
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>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse - 18/Jan/07 08:39 AM
Thanks Jens. Scheduling for 1.2.5

Dan Diephouse - 13/Mar/07 12:38 PM
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)


Dan Diephouse - 13/Mar/07 01:54 PM
I applied the aforementioned fix in SVN. Let me know if that fixes things! Thanks!