I have a web service with JAXB service factory (using XFire 1.2.6)
Null values are not handled properly on the client side. The marshaller
throws an IllegalArgumentException.
For e.g if the service method is
MyObject echo() {
return null;
}
On the client side I get an exception
java.lang.IllegalArgumentException: obj parameter must not be null
at javax.xml.bind.helpers.AbstractMarshallerImpl.checkNotNull(Unknown
Source)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(Unknown Source)
at org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:257)
Debugging into the issue I find an issue with the below function
(AegisBindingProvider.java)
public void writeParameter(MessagePartInfo p,
XMLStreamWriter writer,
MessageContext context,
Object value)
throws XFireFault
{
Type type = (Type) p.getSchemaType();
type = getWriteType(context, value, type);
MessageWriter mw = new ElementWriter(writer);
if (type.isNillable() && type.isWriteOuter() && value == null)
{
mw.writeXsiNil();
return;
}
context.setProperty(CURRENT_MESSAGE_PART, p);
type.writeObject(value, mw, context);
}
type.isWriteOuter() is always false for DocumentType.
Is there a fix or hack to get through this issue.
Thanks,
Swami
--
View this message in context:
http://www.nabble.com/XFire-JAXB-does-not-return-null-values---Marshaller-throws-IllegalArgumentException-tf3953315.html#a11216594
Sent from the XFire - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email