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


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to