I have the same problem, How to resolve it ? It works with the beta 2, not with the beta 3 ... [prev in list] [next in list] [prev in thread] [next in thread] List: axis-user Subject: RE: How to use DateSerializer? (Naresh Bhatia) From: Christian Schmitz <[EMAIL PROTECTED]> Date: 2002-07-03 13:44:20 [Download message RAW] 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:[EMAIL PROTECTED]] Sent: Mittwoch, 3. Juli 2002 14:13 To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 4:49 AM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]] Sent: Mittwoch, 3. Juli 2002 04:54 To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] Sent: Tuesday, July 02, 2002 8:39 PM To: [EMAIL PROTECTED] 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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] > Sent: Dienstag, 2. Juli 2002 17:01 > To: '[EMAIL PROTECTED]' > 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 > > > [Attachment #3 (text/html)] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE>RE: How to use DateSerializer?</TITLE> <META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD> <BODY> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>Hi Naresh,</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002></SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>Thank you for your information first. But,I need your help once again ! </SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>Now I have a partitional success, the format of Date is korrekt and time comes with. But client throws an Exception at Deserialization, </SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>- Could not convert java.util.GregorianCalendar to bean field 'activityDate', type java.util.Date</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002></SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>Thanks,</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002>Christian</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=150533113-03072002></SPAN></FONT> </DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Naresh Bhatia [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Mittwoch, 3. Juli 2002 14:13<BR><B>To:</B> '[EMAIL PROTECTED]'<BR><B>Subject:</B> RE: How to use DateSerializer?<BR><BR></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002>Hi Christian</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002></SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002>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:</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002></SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002> <typeMapping<BR> xmlns:ns="<A href="http://transaction.common.oss.org">http://transaction.common.oss.org</A>"<BR>& \ nbsp; \ qname="ns:Transaction"<BR> \ type="java:org.oss.common.transaction.<STRONG>Transaction</STRONG>"<BR> &nb \ sp; \ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"<BR> & \ nbsp; \ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"<BR> &nb \ sp; encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/enc \ oding/</A>"<BR> /><BR></SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=336495911-03072002>BeanSerializer takes care of the rest. The <STRONG>Transaction</STRONG> class has a getter and setter for for the Date field. Here's what goes over the wire:</DIV></SPAN></FONT> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN class=336495911-03072002> </SPAN><creationTime xsi:type="xsd:dateTime">2002-06-29T14:46:39.257Z</creationTime></FONT></FON \ T></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=336495911-03072002><FONT face=Arial color=#0000ff size=2>Hope this helps.</FONT></SPAN></DIV> <DIV><SPAN class=336495911-03072002><FONT face=Arial color=#0000ff size=2>Naresh</FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Christian Schmitz [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Wednesday, July 03, 2002 4:49 AM<BR><B>To:</B> '[EMAIL PROTECTED]'<BR><B>Subject:</B> RE: How to use DateSerializer?<BR><BR></FONT></DIV> <DIV><SPAN class=049184408-03072002><FONT face=Arial color=#0000ff size=2>Hi Naresh,</FONT></SPAN></DIV> <DIV><SPAN class=049184408-03072002><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN class=049184408-03072002>I testet it with nightly build version. You are right, that the xsd:type is now mapped to dateTime, but the Data still contains </SPAN>a<SPAN class=049184408-03072002> String like this <FONT face="Times New Roman" color=#000000>"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.</FONT></SPAN></FONT></FONT></FONT></DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT face="Times New Roman" color=#000000 size=2><SPAN class=049184408-03072002></SPAN></FONT></FONT></FONT> </DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT face="Times New Roman" color=#000000 size=2><SPAN class=049184408-03072002>Thanks</SPAN></FONT></FONT></FONT></DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT face="Times New Roman" color=#000000 size=2><SPAN class=049184408-03072002>Christian</SPAN></FONT></FONT></FONT></DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN class=049184408-03072002></SPAN></FONT></FONT></FONT> </DIV> <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN class=049184408-03072002> </SPAN></FONT></FONT></FONT><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Naresh Bhatia [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Mittwoch, 3. Juli 2002 04:54<BR><B>To:</B> '[EMAIL PROTECTED]'<BR><B>Subject:</B> RE: How to use DateSerializer?<BR><BR></DIV></FONT> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <P><FONT size=2>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.</FONT></P> <P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: Martin Jericho [<A href="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FON \ T> <BR><FONT size=2>Sent: Tuesday, July 02, 2002 8:39 PM</FONT> <BR><FONT size=2>To: [EMAIL PROTECTED]</FONT> <BR><FONT size=2>Subject: Re: How to use DateSerializer?</FONT> </P><BR> <P><FONT size=2>The bean serializer maps the java Date type to the SOAP "xsd:date" type,</FONT> <BR><FONT size=2>which doesn't include time information. I assume this was intentional,</FONT> <BR><FONT size=2>although I don't particularly like it!</FONT> </P> <P><FONT size=2>To send a date-time (xsd:dateTime), the only way I have found is to use the</FONT> <BR><FONT size=2>Calendar type. Note however that the time zone information is lost when</FONT> <BR><FONT size=2>serialized, and when deserialized is assumed to be GMT. I consider this to</FONT> <BR><FONT size=2>be a bug, as the serializer should either include time zone information or</FONT> <BR><FONT size=2>convert it to GMT, depending on what the RPC standard is capable of. The</FONT> <BR><FONT size=2>work-around is to make sure you create your Calendar objects in GMT before</FONT> <BR><FONT size=2>sending them through axis.</FONT> </P> <P><FONT size=2>I would prefer it if Date was mapped to xsd:date instead of xsd:dateTime.</FONT> <BR><FONT size=2>There could be a new class included with the axis distribution to represent</FONT> <BR><FONT size=2>an xsd:date type in java.</FONT> </P> <P><FONT size=2>----- Original Message -----</FONT> <BR><FONT size=2>From: "Christian Schmitz" <[EMAIL PROTECTED]></FONT> <BR><FONT size=2>To: <[EMAIL PROTECTED]></FONT> <BR><FONT size=2>Sent: Wednesday, July 03, 2002 1:12 AM</FONT> <BR><FONT size=2>Subject: RE: How to use DateSerializer?</FONT> </P><BR> <P><FONT size=2>> I found the answer. I have to use the Factory classes.</FONT> <BR><FONT size=2>> But the response is something like that "2002-07-02". Where is the time</FONT> <BR><FONT size=2>> stored in the Date Object? How can I get it?</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>> -----Original Message-----</FONT> <BR><FONT size=2>> From: Christian Schmitz [<A href="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FON \ T> <BR><FONT size=2>> Sent: Dienstag, 2. Juli 2002 17:01</FONT> <BR><FONT size=2>> To: '[EMAIL PROTECTED]'</FONT> <BR><FONT size=2>> Subject: How to use DateSerializer?</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>> Hi,</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>> I've tried to use DateSerializer from axis to serialize java.util.Date,</FONT> <BR><FONT size=2>but</FONT> <BR><FONT size=2>> a NullPointerException was thrown.</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>> This is my mapping in the deployment file:</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>> <typeMapping</FONT> <BR><FONT size=2>> xmlns:ns="<A target=_blank href="http://pirobase.pironet.de/xsd">http://pirobase.pironet.de/xsd</A>"</FONT> \ <BR><FONT size=2>> qname="ns:Date"</FONT> <BR><FONT size=2>> type="java:java.util.Date"</FONT> <BR><FONT size=2>> serializer="org.apache.axis.encoding.ser.DateSerializer"</FONT> <BR><FONT size=2>> deserializer="org.apache.axis.encoding.ser.DateSerializer"</FONT> <BR><FONT size=2>> encodingStyle="<A target=_blank href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap \ /encoding/</A>"</FONT> <BR><FONT size=2>> /></FONT> \ <BR><FONT size=2>></FONT> <BR><FONT size=2>> Regards</FONT> <BR><FONT size=2>> Christian</FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>></FONT> <BR><FONT size=2>></FONT> </P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML> ------_=_NextPart_001_01C22297.BB797320-- [prev in list] [next in list] [prev in thread] [next in thread] Log in / Log out | Configure Your Environment | About MARC | We're Hiring! | Want to add a list? Tell us about it. | 10East ______________________________________________________________________ Devoteam Siticom Strategic Partner of the French Challenger in the 2003 America's Cup ABOUT THE DEVOTEAM GROUP Devoteam is a leading European Consulting Group in networks and e-business infrastructures. We help our clients build corporate results from innovative information technology solutions. In 2001, pro forma revenues (including Siticom Group) amounted to � 142 MM. The new group has 1,800 employees in eight European countries (France, Belgium, Denmark, Netherlands, UK, Spain, Austria). Devoteam has been listed on the Nouveau March� of Euronext Paris since October 1999 (Euroclear 7379) and joined the NextEconomy segment of Euronext.
