You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Deepal Jayasinghe (JIRA)" <ji...@apache.org> on 2006/11/09 10:24:37 UTC

[jira] Resolved: (AXIS2-1624) RPCMessageReceiver serializes java.util.Date not as "xs:dateTime"

     [ http://issues.apache.org/jira/browse/AXIS2-1624?page=all ]

Deepal Jayasinghe resolved AXIS2-1624.
--------------------------------------

    Resolution: Fixed

fixed in the following rev
472824

> RPCMessageReceiver serializes java.util.Date not as "xs:dateTime"
> -----------------------------------------------------------------
>
>                 Key: AXIS2-1624
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1624
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: rpc
>    Affects Versions: nightly
>         Environment: Windows XP
>            Reporter: Robert Staerk
>         Assigned To: Deepal Jayasinghe
>         Attachments: DatingService.aar, DatingService.wsdl, src.zip
>
>
> I don't know whether this is a bug or a feature.
> When I return an object with two fields, one of type java.util.Calendar and the other of type java.util.Date I get the following SOAP response:
> <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/">
>     <soapenv:Header/>
>     <soapenv:Body>
>         <ns:getDatesResponse xmlns:ns = "http://service.mydomain.com/xsd">
>             <ns:return>
>                 <calendar xmlns = "http://data.mydomain.com/xsd">2006-11-06T21:03:39.781Z</calendar>
>                 <date xmlns = "http://data.mydomain.com/xsd">Mon Nov 06 22:03:39 CET 2006</date>
>             </ns:return>
>         </ns:getDatesResponse>
>     </soapenv:Body>
> </soapenv:Envelope>
> Both fields are of type  "xs:dateTime" in the generated WSDL (see attachment).
> The generated ADB client, however, can for obvious reasons not parse the "Mon Nov 06 22:03:39 CET 2006" and generates the following exception:
> Exception in thread "main" java.lang.RuntimeException: java.lang.NumberFormatException
> 	at com.mydomain.service.DatingServiceStub.fromOM(DatingServiceStub.java:1677)
> 	at com.mydomain.service.DatingServiceStub.getDates(DatingServiceStub.java:160)
> 	at test.DateTest.main(DateTest.java:14)
> Caused by: java.lang.NumberFormatException
> 	at org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(ConverterUtil.java:515)
> 	at com.mydomain.service.DatingServiceStub$MyDate$Factory.parse(DatingServiceStub.java:1049)
> 	at com.mydomain.service.DatingServiceStub$GetDatesResponse$Factory.parse(DatingServiceStub.java:1371)
> 	at com.mydomain.service.DatingServiceStub.fromOM(DatingServiceStub.java:1664)
> 	... 2 more
> Why does RPCMessageReceiver treat java.util.Date differently than java.util.Calendar? 
> I am trying to move severeal Axis 1.3 services to Axis2 and in Axis 1.3 a java.util.Date was serializes as "xs:dateTime".
> Regards, Robert

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org