Marteijn,

This looks like the bug that I reported in bugzilla bug #12451.  Axis forces all times to GMT even if all you want is a local timezone-independent time.  My project needs this because we require the local time to be preserved across timezones.  The Axis developers have put this in the 'resolved-wontfix' basket (I suspect that the issue was just too fuzzy to deal with just before the release of 1.0).  I submitted a replacement for the CalendarDeserializer that fixes this problem for me and I just add it to all Axis releases on my own environment.  The original patch is available at http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12541 but I have included the current source in this note (it's not that long) because I have modified it slightly.

If you're keen to have the issue resolved, I would re-open the bug report on bugzilla.

Regards,

Neil Brennan

==============================================

/*
 * The Apache Software License, Version 1.1
 *
 *
 * Copyright (c) 2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Axis" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */

package org.apache.axis.encoding.ser;

import org.apache.axis.utils.Messages;

import javax.xml.namespace.QName;

import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

/**
 * The CalendarSerializer deserializes a dateTime.
 * Much of the work is done in the base class.
 *
 * @author Sam Ruby (rubys@us.ibm.com)
 * Modified for JAX-RPC @author Rich Scheuerle (scheu@us.ibm.com)
 */
public class CalendarDeserializer extends SimpleDeserializer
{

    // used for local time parsing
    private static SimpleDateFormat LOCAL = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
    // used for GMT time parsing
    private static SimpleDateFormat ZULU = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
    // minimum length of a valid datetime string
    private static int MINLENGTH = 19;

    static
    {
        ZULU.setTimeZone(TimeZone.getTimeZone("GMT"));
    }

    /**
     * The Deserializer is constructed with the xmlType and
     * javaType
     */
    public CalendarDeserializer(Class javaType, QName xmlType)
    {
        super(javaType, xmlType);
    }

    /**
     * The simple deserializer provides most of the stuff.
     * We just need to override makeValue().
     */
    public Object makeValue(String source)
    {
	// sanity
	if (source == null || source.length() == 0)
	{
	    return null;
	}

	// init
        Calendar calendar = Calendar.getInstance();

	// parse for BC
	boolean bc = false;
	if (source.charAt(0) == '+')
	    source = source.substring(1);
	else if (source.charAt(0) == '-')
	{
	    source = source.substring(1);
	    bc = true;
	}

	// parse all valid dates
	try
	{
	    calendar.setTime(parseDate(source));
	}
	catch (ParseException e)
	{
	    throw new NumberFormatException(Messages.getMessage("badDateTime00"));
	}

	// handle BC
	if (bc)
	    calendar.set(Calendar.ERA, GregorianCalendar.BC);

	if (super.javaType == Date.class)
	{
            return calendar.getTime();
        }

	return calendar;
    }

    /**
     * Parses all valid date formats using abilities of DateFormat class.
     *
     * @return date specified.
     */
    private static Date parseDate(String source) throws ParseException
    {
	Date date = null;
	boolean bc = false;

	if (source == null || source.length() < MINLENGTH)
	    throw new NumberFormatException(Messages.getMessage("badDateTime00"));

	if (source.charAt(0) == '+')
	    source = source.substring(1);
	else if (source.charAt(0) == '-')
	{
	    source = source.substring(1);
	    bc = true;
	}

	// handle milliseconds
	if (source.indexOf(".") < 0)
	    source = source.substring(0, MINLENGTH) + ".000" + source.substring(MINLENGTH);

	// handle GMT
	if (source.toUpperCase().indexOf("Z") >= 0)
	    synchronized(ZULU)
	    {
		return ZULU.parse(source);
	    }

	// handle local time
	synchronized(LOCAL)
	{
	    date = LOCAL.parse(source);
	}

	// time zones only apply to local time
	date.setTime(date.getTime() + parseTimeZone(source.substring(MINLENGTH)));

	return date;
    }

    /**
     * Parses time zone information.
     *
     * @return time zone offset in milliseconds.
     */
    private static int parseTimeZone(String source)
    {
	int hours = 0;
	int minutes = 0;
	int pos = 0;

	if ((pos = source.indexOf("+")) >= 0 ||
	    (pos = source.indexOf("-")) >= 0)
	{
	    if (source.length() < pos+2 || !Character.isDigit(source.charAt(pos+1)) || !Character.isDigit(source.charAt(pos+2)))
		throw new NumberFormatException(Messages.getMessage("badTimezone00"));

	    hours = (source.charAt(pos+1)-'0')*10 + source.charAt(pos+2)-'0';

	    if (source.length() > pos+5)
	    {
		if (source.charAt(pos+3) != ':' || !Character.isDigit(source.charAt(pos+4)) || !Character.isDigit(source.charAt(pos+5)))
		    throw new NumberFormatException(Messages.getMessage("badTimezone00"));

		minutes = (source.charAt(pos+4)-'0')*10 + source.charAt(pos+5)-'0';
	    }
	}

	int milliseconds = (hours * 60 + minutes)* 60 * 1000;

	return ((pos = source.indexOf("+")) >= 0) ? -milliseconds : milliseconds;
    }

    /**
     * Test cases.
     */
    public static void main(String[] args) throws Exception
    {
	SimpleDateFormat DEFAULT = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS");

	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:01:07")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:02:06.123")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:03:05Z")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:04:04.123Z")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:05:03.123-05:00")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:06:02+10:33")));
	System.out.println("date: " + DEFAULT.format(parseDate("2002-09-16T12:07:01+03")));
    }

}

-----Original Message-----
From: steve_l@iseran.com [mailto:steve_l@iseran.com]
Sent: Thursday, 24 October 2002 2:33
To: axis-user@xml.apache.org
Subject: Re: Date is not Correct in Soap Message send to server

What time zone is CEST? central european summer time? Which is two hours
ahead of GMT? Looks right to me.

The Date object contains a zone, looks like it is defaulting to UTC 'Z',
which is what goes over the wire
----- Original Message -----
From: <mnouwens@be-value.nl>
To: <axis-user@xml.apache.org>
Sent: Wednesday, October 23, 2002 8:50 AM
Subject: Date is not Correct in Soap Message send to server

Hi, All out There,

I am currently having the following prblem. I Use Axis 1.0 Downloaded it
yesterday. Worked for server moths with beta 3.

In both versions i have the following problem:

I Wrote A Unit test:

            String dateString1=  "12-06-2002";
            Date dateRet =
DateConvertor.convertDateStringToDate(dateString1);
            System.out.println("Date =" + dateRet);
            kl.setAflosDatum(dateRet);
            binding.search(kl);

The OutPut is the Following:

.Date =Wed Jun 12 00:00:00 CEST 2002

on the Console and

<aflosDatum xsi:type="xsd:dateTime">2002-06-11T22:00:00.000Z</aflosDatum>

in the Soap Message

Can some body give me a hint please.

Marteijn Nouwens