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 "Pilani, Rahul" <rp...@cobaltgroup.com> on 2006/12/16 04:29:51 UTC
ISO Date Format
Hi All,
I am having problem with parsing ISO date formats with apache's XML-RPC
library.
The server is returning the date in this format:
2006-12-16T01:40:27Z. But on encountering this date, the SAX Parser
throws an error:
org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse servers
response: Failed to parse integer value: 2006-12-16T01:40:27Z
When I try to use a custom date type, with the following format:
"yyyy-MM-dd'T'HH:mm:ss'Z'" (Basically ignoring the T and the Z) then the
parsing works fine.
I checked the date format, and it conforms to the iso8601 standard, with
the Z signifying UTC time, so I don't want to add my own Date format to
the application (that would basically throw out the time zone
information).
Anyone have a workaround this issue?
Regards,
Rahul Pilani
Re: ISO Date Format
Posted by Jochen Wiedmann <jo...@gmail.com>.
On 12/16/06, Pilani, Rahul <rp...@cobaltgroup.com> wrote:
> I am having problem with parsing ISO date formats with apache's XML-RPC
> library.
The reason is most possibly that "dateTime" in XML-RPC isn't
xs:dateTime, in the sense of XML Schema. For reasons I'll never
understand the XML-RPC specification limits dateTime to a certain
subset of the xs:dateTime syntax. In particular, time zones are
forbidden.
You have the following options:
- Transmit the data as a string and manually convert the calendar
values from/to
a string.
- Reduce your format to the subset, which is permitted by the
XML-RPC specification.
- If both client and server are using Apache XML-RPC, then you might
as well enable
extensions and use calendar values.
Jochen
----
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org