You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Frank Cohen <fc...@pushtotest.com> on 2004/03/13 02:35:46 UTC

java.util.Calendar serializer patch contribution

My open-source framework and utility TestMaker bundles Apache SOAP. A 
user pointed out a problem where he was trying to serialized a 
java.util.Calendar object in a complex data type. The Apache SOAP code 
serializes GregorianCalendar but not Calendar. So, I modified the 
Calendar serializer class. I'm wondering if this is worthwhile to 
submit to the Apache SOAP project as a contribution? I intend to ship 
the modified library with TestMaker 4.0.9 and later.

Please let me know if you want the patch and how to send it. Thanks.

-Frank



--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone: 408 374 7426
Enterprise test automation solutions to check and monitor Web-enabled
applications for functionality, scalability and reliability.


Re: java.util.Calendar serializer patch contribution

Posted by Frank Cohen <fc...@pushtotest.com>.
Thanks Scott. Here's my contribution:

I made these changes to Apache SOAP 2.3.1 in response to a TestMaker 
user that hit an interoperability problem when working with 
java.util.Calendar types in a complex object. When the BeanSerializer 
operated on the complex object it emits an XML element:

<memoCalendar xlmns:ns3="http://java.util" 
xmi:type="ns3:Calendar">2004-03-16T-06:12:23:218Z</memoCalendar>

If this were .NET or Apache Axis the marshalled request element would 
look like this:

<memoCalendar 
xsi:type="xsd:dateTime">2004-03-16T-06:12:23:218Z</memoCalendar>

The customer's Web Service application responded with a SOAP exception 
saying it could not deserialize a java.util.Calendar type. The customer 
is not in control of the complex object (it came in a prepackaged 
signed jar file.)

Attached are three modified files:

DateSerializer.java - I modified this to accept java.util.Date and 
java.util.Calendar objects. Previously it only accepted 
java.util.Calendar.

CalendarSerializer.java - I modified this to accept java.util.Calendar 
and java.util.GregorianCalendar objects. Previously it only accepted 
java.util.GregorianCalendar.

SoapEngUtils.java - I modified this to look for java.util.Calendar 
types and if so it forces the use of a QName object with 
"http://www.w3.org/2001/XMLSchema" and a value of "dateTime".

These changes are a hack to get my customer's application to work. I 
would prefer to work with someone on the Apace SOAP team to design a 
better solution.

I don't like the idea of having branches so perhaps there is a way to 
work together to get this improvement redesigned and part of Apache 
SOAP. I'm open to your ideas.

-Frank



Re: java.util.Calendar serializer patch contribution

Posted by Scott Nichol <sn...@scottnichol.com>.
We are always open to contributions.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Frank Cohen" <fc...@pushtotest.com>
To: <so...@ws.apache.org>
Sent: Friday, March 12, 2004 8:35 PM
Subject: java.util.Calendar serializer patch contribution


My open-source framework and utility TestMaker bundles Apache SOAP. A 
user pointed out a problem where he was trying to serialized a 
java.util.Calendar object in a complex data type. The Apache SOAP code 
serializes GregorianCalendar but not Calendar. So, I modified the 
Calendar serializer class. I'm wondering if this is worthwhile to 
submit to the Apache SOAP project as a contribution? I intend to ship 
the modified library with TestMaker 4.0.9 and later.

Please let me know if you want the patch and how to send it. Thanks.

-Frank



--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone: 408 374 7426
Enterprise test automation solutions to check and monitor Web-enabled
applications for functionality, scalability and reliability.