axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Larry D \(LJOHNSON\)" <LJOHN...@arinc.com>
Subject RE: TimeZone Not Handled Properly In java.util.Date Conversions
Date Mon, 19 Feb 2007 19:04:07 GMT
Amila,

 

How do I set the nillable true on automatically generated WSDL from a
deployed POJO?

 

Regards,

Larry Johnson

________________________________

From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com] 
Sent: Thursday, February 15, 2007 11:59 PM
To: axis-user@ws.apache.org
Subject: Re: TimeZone Not Handled Properly In java.util.Date Conversions

 

 

On 2/16/07, Johnson, Larry D (LJOHNSON) <LJOHNSON@arinc.com> wrote:

I did not specify what platform we are using.  We are currently using
Axis2 v1.1, Java v1.5 and Tomcat 5.5.20.

 

I have also run a similar test using the .NET framework.  The client
receives a DateTime object from the stubs.  On .NET, the value returned
to the client is correct for the current timezone.  This appears to be
an issue in the generated Java stub classes.

 

Also, I saw one additional oddity. As reported below, the WSDL generated
element for the java.util.Date element is as follows:

 

   <xs:element name="departureTime" type="xs:dateTime"/>

 

Even though I have not specified that this should be a required field,
it does not have an attribute of nillable="true"; however the SOAP
message being returned to the client has the form:

 

<departureTime xmlns:nil="http://www.w3.org/2001/XMLSchema-instance"
nil:nil="true" />

 

The nillable attribute is set true here.  On the client side, the
following exception is received:

 

java.lang.RuntimeException : java.lang.NumberFormatException 

       at
com.arinc.afd.clfengine.client.jl.JLCommandProcessorServiceStub.fromOM(U
nknown Source)

       at
com.arinc.afd.clfengine.client.jl.JLCommandProcessorServiceStub.processL
ocateBooking(Unknown Source)

       at
com.arinc.afd.jal.webapp.CLFTestClient.jlLocateBooking(CLFTestClient.jav
a:101 )

       at
com.arinc.afd.jal.webapp.CLFTestClient.main(CLFTestClient.java:315 )

Caused by: java.lang.NumberFormatException

       at
org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(Conve
rterUtil.java:499 )

       at
com.arinc.afd.clfengine.client.jl.JLCommandProcessorServiceStub$Flight$F
actory.parse(Unknown Source)

 

Any thoughts?


ADB  supports nillable attribute .  can you please send your wsdl (set
the nillable true) and the soap request you got from the .NET server? 

	 

	Regards,

	Larry Johnson

	 

	 

	
________________________________


	From: Johnson, Larry D (LJOHNSON) [mailto:LJOHNSON@arinc.com] 
	Sent: Thursday, February 15, 2007 11:59 AM
	To: axis-user@ws.apache.org
	Subject: TimeZone Not Handled Properly In java.util.Date
Conversions

	 

	It seems the conversions of the java.util.Date class are not
being handled properly.  I have defined a server return value of a
java.util.Date.  The WSDL automatically generated for that value is as
follows:

	 

	  <xs:element name="departureTime" type="xs:dateTime"/>

	 

	The client stub is generated using the provided WSDL2Java.  The
client stub returns a java.util.Calendar object for this value.  So far
all is well.  The problem comes in when you start looking into the
handling of the TimeZone from server to client.  Lets say both client
and server are within the "Central Standard Time" zone.  When the server
provides the Date object to the POJO interface, the time is
"1970-01-01T23:55:00.000".  Axis2 then converts that time to a GMT time.
The SOAP message contains "1970-01-02T05:55:00.000Z".  Again all is
well.  When the client gets the Calendar object from the stub classes,
the value is: 01/02/1970 11:55:00 Greenwich Mean Time.  The time value
is incorrect for the TimeZone indicate; however, it is correct for the
local TimeZone.

	 

	The client simply performs the following:

	 

	    responeData.getDepartureTime();

	 

	Am I missing something here?  Should the returned Calendar
either keep the time consistent with GMT or convert the time to local
time while changing the TimeZone to indicate the local TimeZone?

	 

	Regards,

	Larry Johnson




-- 
Amila Suriarachchi,
WSO2 Inc. 


Mime
View raw message