I think we all agreed many posts ago that it is best (if not elementary)
to transfer dates via plain strings, defined in schema. It definitely
doesn't cause you any integration issues since you take the date and
simply build the appropriate object from it. (Surprisingly ugly, for
Java).

// Take a string and create a Calendar object from it
Date requiredDate = null;
String existingString = "2007-05-10T15:22:07.000Z"; // Get this from web
service
SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
try {
        requiredDate = sdf.parse(formattedStr);
}
catch (java.text.ParseException pe) {
        System.out.println("We got a parsing exception: " +
pe.getMessage()); 
}
Calendar newCal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
newCal.setTime(requiredDate);

You might need to pass the timezone as a separate string field, I think.
Here I used "GMT" but you will pass it as a separate parameter in a web
service call.


Also, looking at Axis 1.3 src it builds a SimpleDateFornmat object from
the GMT timezone. There is no way to change that unless you edit the
org.apache.axis.encoding.ser.CalendarSerializer class and then recompile
Axis. Yuk.
-jeff

 





-----Original Message-----
From: Ford, Jennifer M. [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 05, 2007 4:05 PM
To: [email protected]
Subject: RE: axis Calendar time zones

Unfortunately, I don't think that's possible.  You'll just have to
translate to/from GMT on each end.

-----Original Message-----
From: Simon Steinacker [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 05, 2007 2:57 PM
To: [email protected]; [EMAIL PROTECTED]
Subject: axis Calendar time zones

Hello,

I am currently using axis 1.3, working with java Calendar objects across
Web Services.
I realized, that axis by default sets the timezone to GMT when
serializing dates.

How can I tell axis which timezone it should use?
Thanks a lot,
Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to