You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Henri Gomez <he...@gmail.com> on 2006/05/16 14:00:56 UTC

XML RPC 3.0 - Current Date support break XML-RPC specs

Hi to all,

While working on XML-RPC 3.0 integration in some applications, I see
that the current implementation break compatibility with XML-RPC
specs, including XML-RPC 1.2/2.0 implementations.

The implementation say that Date should be coded like this :

<dateTime.iso8601>	date/time	19980717T14:08:55

As such you could provide and get back java.util.Date.

The current implementation make use of Calendar and format Date in form :

AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex: 2005-11-21T00:00:00+01:00)

This bad formating came from the use of XsDateTimeFormat.

My recommandation will be to restore use of Date in the XML-RPC specs
format and make Calendar support in extensions.

If nobody has objections, I'll commit fixes by the end of the week

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Henri Gomez <he...@gmail.com>.
Yes, it's fine for me.

Thanks for these

2006/5/20, Jochen Wiedmann <jo...@gmail.com>:
>
> Hi,
>
> ok, I found the flaw in my suggestion: Auto detection of Calendar or Date
> works fine for parameters, but not for result values.
>
> After rethinking our options, I decided to drop my veto and have changed the
> code in the following manner:
>
> - dateTime.iso8601 is now mapped to instances of java.util.Date, and vice
>   versa. Formatting and parsing is done by a new type XmlRpcDateTimeFormat,
>   which is basically a copy of XsDateTimeFormat.
>
> - A new type ex:dateTime has been introduced, which is mapped to instances
>   of java.util.Calendar, and vice versa. Formatting and parsing is done by
>   an instance of XsDateTimeFormat.
>
> - Timezone handling is implemented by a new property
>      XmlRpcConfig.getTimeZone(),
>   which defaults to TimeZone.getDefault(). For obvious reasons, this
>   property applies to dateTime.iso8601 only, because instances of Calendar
>   and xs:dateTime both contain timezone information.
>
> - Support for milliseconds in dateTime.iso8601 (thus java.util.Date) is
>   not available. I am unlucky about this point, but I do not see how to
>   change things.
>
> Hope, that's fine for everyone, in particular Henri.
>
>
> Jochen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
>
>

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


Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Jochen Wiedmann <jo...@gmail.com>.
Hi,

ok, I found the flaw in my suggestion: Auto detection of Calendar or Date
works fine for parameters, but not for result values.

After rethinking our options, I decided to drop my veto and have changed the
code in the following manner:

- dateTime.iso8601 is now mapped to instances of java.util.Date, and vice
  versa. Formatting and parsing is done by a new type XmlRpcDateTimeFormat,
  which is basically a copy of XsDateTimeFormat.

- A new type ex:dateTime has been introduced, which is mapped to instances
  of java.util.Calendar, and vice versa. Formatting and parsing is done by
  an instance of XsDateTimeFormat.

- Timezone handling is implemented by a new property
     XmlRpcConfig.getTimeZone(),
  which defaults to TimeZone.getDefault(). For obvious reasons, this
  property applies to dateTime.iso8601 only, because instances of Calendar
  and xs:dateTime both contain timezone information.

- Support for milliseconds in dateTime.iso8601 (thus java.util.Date) is
  not available. I am unlucky about this point, but I do not see how to
  change things.

Hope, that's fine for everyone, in particular Henri.


Jochen



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


Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Henri Gomez <he...@gmail.com>.
Ok, will try this patch.

Where could I find new version of ws-commons-util ?

2006/5/18, Jochen Wiedmann <jo...@gmail.com>:
> Henri Gomez wrote:
>
> > Upward compatibility with what ?
>
> With existing XML-RPC code. Attached you find a proposed patch, which
> converts calendar values into date objects on the fly, if required. Please
> verify, whether it suits you.
>
> Note, that I have fixed the bug with the added timezone information. (You'll
> need a new version of ws-commons-util.)
>
>
> Jochen
>
>
>
>

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Jochen Wiedmann <jo...@gmail.com>.
Henri Gomez wrote:

> Upward compatibility with what ?

With existing XML-RPC code. Attached you find a proposed patch, which
converts calendar values into date objects on the fly, if required. Please
verify, whether it suits you.

Note, that I have fixed the bug with the added timezone information. (You'll
need a new version of ws-commons-util.)


Jochen


Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Henri Gomez <he...@gmail.com>.
2006/5/17, Jochen Wiedmann <jo...@gmail.com>:
> Henri Gomez wrote:
>
> > When I saw SPEC I see Date should be used not Calendar.
>
> What Spec? The XML-RPC spec is completely unrelated to Java.
>
> > Using Calendar instead of Date broke link with existing XML-RPC
> > implementations, including XML-RPC 1.2 and 2.0 so we should use Date.
>
> Did you read my last suggestion, which should also be able to restore
> upwards compatibility?

Upward compatibility with what ? I'm using XML-RPC with non Java
client, and for instance some customers use PHP or C/C++ APIs and need
to stick with BASIC XML-RPC specs.

If I want more advanced Java support, I could choose on the client and
server to activate extensions, and so get BigDecimal / BigInteger /
Calendars / DOM and so on.

Or I could select SOAP.

But when using XML-RPC 3.0 without extensions, I want to be 100%
compatible with current Java, PHP, C/C++ implementations, so we should
have Date without TimeZone and no Calendar.

For instance, I host many services on the same JVM and I don't want to
have some parts of the applications using XML-RPC 2.0.1 and the others
one XML-RPC 3.0, it will be a nigthmare for configuration and
classloader.


> > Also the format is :
> >
> > <dateTime.iso8601>    date/time    19980717T14:08:55
> >
> > Nothing like AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex:
> > 2005-11-21T00:00:00+01:00), which is the SOAP date  encoding.
> >
> > My patch restore use of java.util.Date as previously and provide
> > Calendar as an extension.
>
> Again, the format issue can be resolved within XsDateTimeFormat as well. And
> your patch has the disadvantage, that we loose the ability to support the
> timezones while extensions are active. Which we should, as John has agreed.

I've got no problem with TimeZone, but we should keep it in extension
mode for someone requesting a Timezonable object, like the Calendar.
That's why I do the patch like this.

Or we should use a different mechanism, where configuration for
Parser/Serializer will not be hardcoded to let people select what they
want in standard XML-RPC and what they want in extensions. It could be
done easily by a simple .xml file for example.

> Jochen

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Jochen Wiedmann <jo...@gmail.com>.
Henri Gomez wrote:

> When I saw SPEC I see Date should be used not Calendar.

What Spec? The XML-RPC spec is completely unrelated to Java.

> Using Calendar instead of Date broke link with existing XML-RPC
> implementations, including XML-RPC 1.2 and 2.0 so we should use Date.

Did you read my last suggestion, which should also be able to restore
upwards compatibility?


> Also the format is :
> 
> <dateTime.iso8601>    date/time    19980717T14:08:55
> 
> Nothing like AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex:
> 2005-11-21T00:00:00+01:00), which is the SOAP date  encoding.
> 
> My patch restore use of java.util.Date as previously and provide
> Calendar as an extension.

Again, the format issue can be resolved within XsDateTimeFormat as well. And
your patch has the disadvantage, that we loose the ability to support the
timezones while extensions are active. Which we should, as John has agreed.


Jochen

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Henri Gomez <he...@gmail.com>.
Here is the patch against trunk.

I also added in org.apache.xmlrpc.util the old DateTool from 2.0.1

explanations :

- restore association of dateTime.iso8601 with java.util.Date and
DateTool for serial/parse

- add Calendar object support as an extension.

Which such configuration, XML-RPC 3.0 is now compatible with older
XML-RPC implementations 1.2/2.0 and PHP client I tested.

Regards

2006/5/16, Henri Gomez <he...@gmail.com>:
> When I saw SPEC I see Date should be used not Calendar.
>
> Using Calendar instead of Date broke link with existing XML-RPC
> implementations, including XML-RPC 1.2 and 2.0 so we should use Date.
>
> Also the format is :
>
> <dateTime.iso8601>      date/time       19980717T14:08:55
>
> Nothing like AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex:
> 2005-11-21T00:00:00+01:00), which is the SOAP date  encoding.
>
> My patch restore use of java.util.Date as previously and provide
> Calendar as an extension.
>
> I'll send it tomorrow here.
>
> Regards
>
>
> 2006/5/16, Jochen Wiedmann <jo...@gmail.com>:
> > John Wilson wrote:
> >
> > > By all means introduce an extension which allows this form but the
> > > unextended implementation should conform to the standard.
> >
> > As for the last part: I do believe we all agree on that. Question is whether
> > implicit support is acceptable, following the mantra "strict on the output,
> > lazy on the input". Personally, I'd vote in favour of that.
> >
> > Henri, a suggested solution: I believe we do agree that support for
> > java.util.Calendar as well as java.util.Date is easy when creating XML.
> > However, we could possibly offer a solution for the parsing side too: The
> > method ReflectiveXmlRpcHandler.execute() could check for instances of
> > java.util.Calendar. If it detects such instances, then it could check
> > whether the corresponding parameter should be java.util.Date and, if so,
> > convert it. That way we should both be upwards compatible and be able to
> > offer timezone support.
> >
> >
> > Jochen
> >
> >
>

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Henri Gomez <he...@gmail.com>.
When I saw SPEC I see Date should be used not Calendar.

Using Calendar instead of Date broke link with existing XML-RPC
implementations, including XML-RPC 1.2 and 2.0 so we should use Date.

Also the format is :

<dateTime.iso8601>	date/time	19980717T14:08:55

Nothing like AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex:
2005-11-21T00:00:00+01:00), which is the SOAP date  encoding.

My patch restore use of java.util.Date as previously and provide
Calendar as an extension.

I'll send it tomorrow here.

Regards


2006/5/16, Jochen Wiedmann <jo...@gmail.com>:
> John Wilson wrote:
>
> > By all means introduce an extension which allows this form but the
> > unextended implementation should conform to the standard.
>
> As for the last part: I do believe we all agree on that. Question is whether
> implicit support is acceptable, following the mantra "strict on the output,
> lazy on the input". Personally, I'd vote in favour of that.
>
> Henri, a suggested solution: I believe we do agree that support for
> java.util.Calendar as well as java.util.Date is easy when creating XML.
> However, we could possibly offer a solution for the parsing side too: The
> method ReflectiveXmlRpcHandler.execute() could check for instances of
> java.util.Calendar. If it detects such instances, then it could check
> whether the corresponding parameter should be java.util.Date and, if so,
> convert it. That way we should both be upwards compatible and be able to
> offer timezone support.
>
>
> Jochen
>
>

Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Jochen Wiedmann <jo...@gmail.com>.
John Wilson wrote:

> By all means introduce an extension which allows this form but the
> unextended implementation should conform to the standard.

As for the last part: I do believe we all agree on that. Question is whether
implicit support is acceptable, following the mantra "strict on the output,
lazy on the input". Personally, I'd vote in favour of that.

Henri, a suggested solution: I believe we do agree that support for
java.util.Calendar as well as java.util.Date is easy when creating XML.
However, we could possibly offer a solution for the parsing side too: The
method ReflectiveXmlRpcHandler.execute() could check for instances of
java.util.Calendar. If it detects such instances, then it could check
whether the corresponding parameter should be java.util.Date and, if so,
convert it. That way we should both be upwards compatible and be able to
offer timezone support.


Jochen


Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by John Wilson <tu...@wilson.co.uk>.
On 16 May 2006, at 21:30, Jochen Wiedmann wrote:

> For the record: IMO, it is a very severe problem of the official  
> XML-RPC
> spec, to forbid the timezone part of xs:dateTime.

I quite agree. However the spec says that the timezone should not be  
present. Therefore a compliant implementation should not emit a  
timezone.

By all means introduce an extension which allows this form but the  
unextended implementation should conform to the standard.



John Wilson
The Wilson Partnership
web http://www.wilson.co.uk
blog http://eek.ook.org



Re: XML RPC 3.0 - Current Date support break XML-RPC specs

Posted by Jochen Wiedmann <jo...@gmail.com>.
Hi, Henri,

Henri Gomez wrote:

> While working on XML-RPC 3.0 integration in some applications, I see
> that the current implementation break compatibility with XML-RPC
> specs, including XML-RPC 1.2/2.0 implementations.
> 
> The implementation say that Date should be coded like this :
> 
> <dateTime.iso8601>    date/time    19980717T14:08:55
> 
> As such you could provide and get back java.util.Date.
> 
> The current implementation make use of Calendar and format Date in form :
> 
> AAAA-MM-JJTHH:MM:SS+ZZ:ZZ (ex: 2005-11-21T00:00:00+01:00)
> 
> This bad formating came from the use of XsDateTimeFormat.
> 
> My recommandation will be to restore use of Date in the XML-RPC specs
> format and make Calendar support in extensions.
> 
> If nobody has objections, I'll commit fixes by the end of the week

not so fast. Please let's be careful.

First of all, please let's clearly separate between two completely unrelated
issues:

- the question whether java.util.Calendar, or java.util.Date is being
  choosen as the default object type for representing dateTime

- possible problems in the output generated by XsDateTimeFormat

The former point is subject to discussion. As already noticed, we clearly
disagree on that. So I'd expect that you'd at least leave room for
discussion with others. before we conclude, possibly by holding a vote.

For the record: IMO, it is a very severe problem of the official XML-RPC
spec, to forbid the timezone part of xs:dateTime. The discussions on this
mailing list have clearly demonstrated, that simply omitting the timezone is
inappropriate. The main theme for 3.0 is: Be compliant to the spec, if
required, but offer more, if requested. In other words: The possibility to
use an official xs:dateTime string is a serious and very valuable extension.

However, support for any valid xs:dateTime cannot be done with TextFormat.
It simply isn't powerful enough. Hence the decision for XsDateTimeFormat.
There is no problem in adding configuration parameters to this class, if
required. All ws developers (in particular xml-rpc developers) have
sufficient karma to add required changes.


Jochen