After a lot of tries, I manage to do the follwoing :

  <bean id="xfire.typeMappingRegistry"
    class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry"
    init-method="createDefaultMappings" singleton="true">
    <property name="configuration">
      <bean class="org.codehaus.xfire.aegis.type.Configuration">
        <property name="defaultMinOccurs" value="1" />
        <property name="defaultNillable" value="true" />
      </bean>
    </property>
  </bean>

if I set defaultNillable to false, all the types (i.e including string) are
not outputed if the value is null.
But if I set nillable to true, the string values are correctly outputted as
null but the dates still not appear in the output (even with minOccurs = 1)
!

FYI, I am using 1.1.2 : can this be related (i.e has a future version change
something in the date serializing) ?

Thanks for any help, I am getting really desesperated about this date
serializing...

chris


christophe blin wrote:
> 
> Hi,
> 
> thanks for the answer....
> 
> However, that brings 2 more questions to my mind :
> 
> 1. Is there a way to configure xfire globally (i.e not saying on evey
> field that minOccurs=1) so that each and every field is ALWAYS in the
> ouput directly from Spring ? (in http://xfire.codehaus.org/Aegis+Binding,
> it is explained how to make it in Java but I do not manage to do that
> directly in a Spring application context)
> 
> 2. Why String has not a similar behavior ?
> 
> Again thanks for the clear answer,
> 
> regards,
> 
> chris
> 
> 
> 
> 
> Benson Margulies-2 wrote:
>> 
>> If the xml schema element has minOccurs=0 nullable=true (the default)
>> then a null Java field of type Data will 'disappear' in the output. If
>> you force minOccurs=1 then you will get a null.
>> 
>> -----Original Message-----
>> From: christophe blin [mailto:[EMAIL PROTECTED] 
>> Sent: Tuesday, January 02, 2007 11:42 AM
>> To: [email protected]
>> Subject: [xfire-user] Problem to serialize null date ?
>> 
>> 
>> Hi,
>> 
>> I'd like to know if someone encounter problem with the XFire
>> serialization
>> and a java.util.Date getter
>> 
>> When I use this class :
>> class Test {
>>   private Date date1;
>>   private Long long1;
>>   /*getter and setter skipped*/
>> }
>> 
>> and when a method returns such an Object, if date1 is null then the
>> field
>> does not appear in the SOAP response whereas if long1 is null then it
>> contains <long1 xsi:nil="true" />.
>> 
>> Does anybody knows what I am doing wrong (or maybe xfire is doing wrong)
>> 
>> regards,
>> 
>> chris
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Problem-to-serialize-null-date---tf2908795.html#a8
>> 126631
>> Sent from the XFire - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-to-serialize-null-date---tf2908795.html#a8138099
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to