axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mauro Molinari (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-4370) Time portion of java.util.Date is missing from SOAP response in Axis2 1.5
Date Thu, 01 Jul 2010 07:29:57 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884200#action_12884200
] 

Mauro Molinari commented on AXIS2-4370:
---------------------------------------

Given that the API Java provides for time and date manipulations are awful (from a practical
point of view), the Axis2 mapping of xsd:date<=>java.util.Date and xsd:dateTime<=>java.util.Calendar
is nothing more than a convention. So, once you know this convention, I still can't understand
why you want to map Date with xsd:dateTime at all costs, given that it's quite easy to get
a Date from a Calendar and viceversa.

I think the reason behind this choice is just a good sense thought that if someone chooses
xsd:dateTime he may be trying to express an information which is more accurate than the case
he chooses xsd:date... and of course the information retrievable from a Calendar is more complete
than that retrievable from a Date. So I think this is the most natural choice, without the
useless complication of having two Java types that could be equally used interchangeably in
theory.

Actually, the real problem for me is that Axis2 documentation is very poor: it should be clearly
written somewhere what the mapping convention is and not only on Amila's blog (I'm talking
about the link Amila sometimes points users to regarding this issue).

This is my own opinion, although, of course, it's always possible to do better (i.e.: support
Joda Time or JSR-310, as Pétur suggested) and to correct bugs if there are legal cases not
covered by the conversion utils, as the last comment seems to point out.

> Time portion of java.util.Date is missing from SOAP response in Axis2 1.5
> -------------------------------------------------------------------------
>
>                 Key: AXIS2-4370
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4370
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.5
>            Reporter: Pétur Runólfsson
>         Attachments: Server-1.4.1.wsdl, Server-1.5.wsdl, Server.java, services.xml
>
>
> When a method returns a java.util.Date (or an object containing a java.util.Date), only
the date portion is returned in Axis2 1.5:
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>    <soapenv:Body>
>       <ns:getCurrentTimeResponse xmlns:ns="http://ws.apache.org/axis2">
>          <ns:return>2009-06-10</ns:return>
>       </ns:getCurrentTimeResponse>
>    </soapenv:Body>
> </soapenv:Envelope>
> In Axis2 1.4.1, the full date and time was returned:
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>    <soapenv:Body>
>       <ns:getCurrentTimeResponse xmlns:ns="http://ws.apache.org/axis2">
>          <ns:return>2009-06-10T16:22:22.622Z</ns:return>
>       </ns:getCurrentTimeResponse>
>    </soapenv:Body>
> </soapenv:Envelope>
> This change breaks any application that requires the time portion to function correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message