axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schmitz <cschm...@pironet-ndh.com>
Subject RE: How to use DateSerializer? (Naresh Bhatia)
Date Wed, 03 Jul 2002 13:44:20 GMT
Hi Naresh,
 
Thank you for your information first. But,I need your help once again ! 
Now I have a partitional success, the format of Date is korrekt and time
comes with. But client throws an Exception at Deserialization, 
- Could not convert java.util.GregorianCalendar to bean field
'activityDate', type java.util.Date
 
Thanks,
Christian
 

-----Original Message-----
From: Naresh Bhatia [mailto:NBhatia@sapient.com]
Sent: Mittwoch, 3. Juli 2002 14:13
To: 'axis-user@xml.apache.org'
Subject: RE: How to use DateSerializer?


Hi Christian
 
There is no mapping in my deployment file for my Date field directly,
because it is a embedded in another type. The entry for that type is as
follows:
 
      <typeMapping
        xmlns:ns=" http://transaction.common.oss.org
<http://transaction.common.oss.org> "
        qname="ns:Transaction"
        type="java:org.oss.common.transaction.Transaction"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> "
      />

BeanSerializer takes care of the rest. The Transaction class has a getter
and setter for for the Date field. Here's what goes over the wire:
 
    <creationTime
xsi:type="xsd:dateTime">2002-06-29T14:46:39.257Z</creationTime>
 
Hope this helps.
Naresh

-----Original Message-----
From: Christian Schmitz [mailto:cschmitz@pironet-ndh.com]
Sent: Wednesday, July 03, 2002 4:49 AM
To: 'axis-user@xml.apache.org'
Subject: RE: How to use DateSerializer?


Hi Naresh,
 
I testet it with nightly build version. You are right, that the xsd:type is
now mapped to dateTime, but the Data still contains a String like this
"2002-07-02".  can you please send me your mapping entry in your  deployment
file? I think this is the only position where I coult have made something
wrong.
 
Thanks
Christian
 
 -----Original Message-----
From: Naresh Bhatia [mailto:NBhatia@sapient.com]
Sent: Mittwoch, 3. Juli 2002 04:54
To: 'axis-user@xml.apache.org'
Subject: RE: How to use DateSerializer?



I am currently using the nightly build of Axis. It appears that Date is now
correctly mapped to xsd:dateTime. And that is what JAX-RPC specification
asks for. I have found that the conversion to/from Date works fine for this
build.

-----Original Message----- 
From: Martin Jericho [ mailto:martin.j@jabcreative.com
<mailto:martin.j@jabcreative.com> ] 
Sent: Tuesday, July 02, 2002 8:39 PM 
To: axis-user@xml.apache.org 
Subject: Re: How to use DateSerializer? 


The bean serializer maps the java Date type to the SOAP "xsd:date" type, 
which doesn't include time information.  I assume this was intentional, 
although I don't particularly like it! 

To send a date-time (xsd:dateTime), the only way I have found is to use the 
Calendar type.  Note however that the time zone information is lost when 
serialized, and when deserialized is assumed to be GMT.  I consider this to 
be a bug, as the serializer should either include time zone information or 
convert it to GMT, depending on what the RPC standard is capable of.  The 
work-around is to make sure you create your Calendar objects in GMT before 
sending them through axis. 

I would prefer it if Date was mapped to xsd:date instead of xsd:dateTime. 
There could be a new class included with the axis distribution to represent 
an xsd:date type in java. 

----- Original Message ----- 
From: "Christian Schmitz" <cschmitz@pironet-ndh.com> 
To: <axis-user@xml.apache.org> 
Sent: Wednesday, July 03, 2002 1:12 AM 
Subject: RE: How to use DateSerializer? 


> I found the answer. I have to use the Factory classes. 
> But the response is something like that "2002-07-02". Where is the time 
> stored in the Date Object? How can I get it? 
> 
>  -----Original Message----- 
> From: Christian Schmitz [ mailto:cschmitz@pironet-ndh.com
<mailto:cschmitz@pironet-ndh.com> ] 
> Sent: Dienstag, 2. Juli 2002 17:01 
> To: 'axis-user@xml.apache.org' 
> Subject: How to use DateSerializer? 
> 
> Hi, 
> 
> I've tried to use DateSerializer from axis to serialize java.util.Date, 
but 
> a NullPointerException was thrown. 
> 
> This is my mapping in the deployment file: 
> 
>   <typeMapping 
> xmlns:ns=" http://pirobase.pironet.de/xsd <http://pirobase.pironet.de/xsd>
" 
> qname="ns:Date" 
> type="java:java.util.Date" 
> serializer="org.apache.axis.encoding.ser.DateSerializer" 
> deserializer="org.apache.axis.encoding.ser.DateSerializer" 
> encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> " 
>    /> 
> 
> Regards 
> Christian 
> 
> 
> 


Mime
View raw message