Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 84107 invoked from network); 26 Jun 2005 13:05:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2005 13:05:17 -0000 Received: (qmail 82115 invoked by uid 500); 26 Jun 2005 13:05:13 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 82002 invoked by uid 500); 26 Jun 2005 13:05:12 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 81988 invoked by uid 99); 26 Jun 2005 13:05:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jun 2005 06:05:12 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=RCVD_BY_IP,TO_ADDRESS_EQ_REAL X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of vreddyp@gmail.com designates 64.233.170.202 as permitted sender) Received: from [64.233.170.202] (HELO rproxy.gmail.com) (64.233.170.202) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jun 2005 06:05:12 -0700 Received: by rproxy.gmail.com with SMTP id j1so735374rnf for ; Sun, 26 Jun 2005 06:05:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Lw/wMNya6YhnIHNhI9emvdC/AaXBamujt8OTsvHAqG6NkJwZvKoobSAr15k3fJaGmUsmaT9TqBBfoj3oVe1AoNIXg/9VkRz+a9UUa59aGhSSiXSmWqTlJS9Y6wghh/gvRV+Y7OYrqNuxiiRhjL0yIKcW4QLLjp/3H9sS0mo4fhg= Received: by 10.38.97.10 with SMTP id u10mr527444rnb; Sun, 26 Jun 2005 06:05:09 -0700 (PDT) Received: by 10.38.89.4 with HTTP; Sun, 26 Jun 2005 06:05:09 -0700 (PDT) Message-ID: Date: Sun, 26 Jun 2005 18:35:09 +0530 From: Venkat Reddy Reply-To: Venkat Reddy To: "axis-dev@ws.apache.org" Subject: Re: [jira] Commented: (AXIS-1456) Mapping of service interfaces defined using java.sql.Date to xsd:date does not work In-Reply-To: <19e0530f05062605532353126d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <939010866.1089888999524.JavaMail.apache@nagoya> <507214291.1119789057669.JavaMail.jira@ajax.apache.org> <19e0530f05062605532353126d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I agree. One last tiny question :-) we can possibly get java.util.Date from xsd:dateTime instead of xsd:date, for default cases? - venkat On 6/26/05, Davanum Srinivas wrote: > Venkat, >=20 > See from the point of view of someone using Axis. they would be > confused if they get a java.util.sql.Date. can't hack the code just to > get roundtrip working. I will look more. >=20 > -- dims >=20 > On 6/26/05, Venkat Reddy wrote: > > Well, it does map to java.util.Calendar as required by JAX-RPC when > > the typemapping flag is appropriately specified. But without the type > > mapping switch, may be it can default to java.util.sql.Date. > > Otherwise, is there a way we can make the roundtrip test case work > > (which i submitted)?. > > > > - venkat > > > > On 6/26/05, Davanum Srinivas (JIRA) wrote: > > > [ http://issues.apache.org/jira/browse/AXIS-1456?page=3Dcomments#= action_12314505 ] > > > > > > Davanum Srinivas commented on AXIS-1456: > > > ---------------------------------------- > > > > > > that's against JAXRPC spec > > > > > > -- dims > > > > > > > Mapping of service interfaces defined using java.sql.Date to xsd:da= te does not work > > > > -------------------------------------------------------------------= ---------------- > > > > > > > > Key: AXIS-1456 > > > > URL: http://issues.apache.org/jira/browse/AXIS-1456 > > > > Project: Apache Axis > > > > Type: Bug > > > > Components: Serialization/Deserialization > > > > Versions: 1.1 > > > > Environment: Multiple environments (i.e. UNIX and Windows based) > > > > Reporter: Alan Murphy > > > > Assignee: Venkat Reddy > > > > Attachments: DateDeserializer.java.patch, sqldate-testcase.zip > > > > > > > > Whilst JAX-RPC does not define a standard mapping from a Java class= to xsd:date, Apache Axis has a non standard extension which maps service i= nterfaces defined using java.sql.Date to xsd:date. Unfortunately this does = not work out-of-the-box. When a parameter of type xsd:date is sent from a c= lient stub to an AXIS server, it is erroneously deserialized as a java.util= .Date. This is despite the fact that both the WSDD, and XML request, specif= y that the parameter is of type XSD:Date, rather than XSD:DateTime. > > > > The resultant effect of this incorrect deserialization, is that AXI= S will erroneously try to find a method to invoke with a java.util.Date in = it's signature, rather than a java.sql.Date (which the method signature act= ually specifies), and hence will throw a 'no such method error'. > > > > The problem is resolved by implementing a custom deserializer which= , when registered against the type java.sql.Date, merely converts the incor= rectly deserialized java.util.Date to a java.sql.Date, allowing AXIS to inv= oke the correct method. > > > > The code for the overriden makeValue function of the custom deseria= lizer is as follows: > > > > public Object makeValue(String source) { > > > > > > > > Object obj =3D super.makeValue(source); > > > > > > > > if (javaType =3D=3D java.sql.Date.class) { > > > > if (obj instanceof java.sql.Date) { > > > > return obj; > > > > } else if (obj instanceof java.util.Date) { > > > > return new java.sql.D= ate(((java.util.Date)obj).getTime()); > > > > } > > > > } > > > > > > > > if (javaType =3D=3D java.util.Date.class) { > > > > if (obj instanceof java.util.Date) { > > > > return obj; > > > > } > > > > } > > > > > > > > throw new RuntimeException( > > > > "cannot convert " + obj.getClass().getName() + " to "= + javaType.getName() > > > > ); > > > > } > > > > > > -- > > > This message is automatically generated by JIRA. > > > - > > > If you think it was sent incorrectly contact one of the administrator= s: > > > http://issues.apache.org/jira/secure/Administrators.jspa > > > - > > > For more information on JIRA, see: > > > http://www.atlassian.com/software/jira > > > > > > > > >=20 >=20 > -- > Davanum Srinivas -http://blogs.cocoondev.org/dims/ >