I just found a solution,
his :
There is a, may be, a bug in org.apache.axis.encoding.ConstructorTarget.
When axis instanciate a class with a custom constructor (no the default
parameterless), it check if class type from webservice are same as
constructor parameters, here is the code that do this :
if
(values.get(i).getClass().getName().toLowerCase().indexOf(classes[c].getName().toLowerCase())
!= -1)
The problem is
the bean class contructor (for me) take a java.util.calendar and the
webservice return a java.util.gregorianCalendar, indexOf failed.
To correct it without changed axiscode. I change the bean class contructor
(generated with wsdl2java) to take gregoriancalendar.
unrealone wrote:
>
> Hallo,<br/>
> I have a strange problem with getting Calendar/Date (java.util.*) objects
> via an Axis/SOAP method. The method's return type is a complex type mapped
> as a bean with the <em>beanMapping</em> tag and this complex type has a
> Date field (I tried both Date and Calendar - neither worked).<br/>
> <br/>
> When calling the method from the client, an exception is thrown upon
> deserialization:<br/><br/>
> <font color="#FF0000">org.xml.sax.SAXException: No object was found for
> class type class java.util.Calendar</font><br/><br/>
> This is even more strange, since I set up another test method that simply
> returns a Calendar (or Date - again I tried both) instance. This method
> works just fine so I really don't see how this is different from the
> previous bean-field case.<br/>
> <br/>
> Just to summarize again:<br/>
> case #1 - <font color="#FF0000">complex bean-mapped type with a field of
> the type java.util.Date or java.util.Calendar returned by the webservice
> method - the above-mentioned exception is thrown upon
> deserialization</font><br/>
> <br/>
> case #2 - <font color="#0000FF">just java.util.Date or java.util.Calendar
> (Axis should handle ser/deser automatically - so no mapping or other black
> magic) returned by a webservice method - everything OK</font><br/>
> <br/>
> <br/>
> PLUS I checked the request/response with the <em>tcpmon</em> utility and
> the Date/Calendar values are serialized the same way in both cases:<br/>
> <br/>
> <date
> xsi:type="xsd:dateTime">2006-08-30T12:33:50.197Z</date><br/>
> <br/>
> I am 99% sure that the complex classes' beanMapping is correct - when I
> remove the Date field, the object gets from the server to the client with
> NO PROBLEMS.
> <br/><br/>
> <font color="#0000FF">I'll appreciate any help you can give me - I feel
> kind of silly to even ask this since the issue looks quite elementary, but
> it's just not working for me</font>
>
>
> <hr>
> some sources here:<br/>
> <br/>
> <xmp>
> public class CdrRecordSO implements Serializable {
> ...
> private Calendar date; // THIS IS THE FIELD THAT CAUSES PROBLEMS
>
> public Calendar getDate() {
> return this.date;
> }
>
> public void setDate(Calendar date) {
> this.date = date;
> }
> ...
> }
> </xmp>
>
>
--
View this message in context:
http://www.nabble.com/No-object-was-found-for-class-type-class-java.util.Calendar-tf2190378.html#a6442007
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]