"datetime" wsdl type -> Calendar : cannot instantiate abstract class java.util.Calendar

From: Pedro Salazar <pedro-b-salazar_at_PTINOVACAO.PT>
Date: Mon, 13 Jan 2003 12:00:56 +0000


I'm trying to create a JAXRPC Web Service from a WSDL file, but
unfortunately a "datetime" wsdl type parameter in my web service
method is giving me a few problems.

In the wsdeploy process it's being created a java.util.Calendar Java object,
that will result in run-time error in my web service saying that it cannot
 instantiate an Abstract Class (java.util.Calendar)! Probably due the
default constructor requirements assumed in RMI for JAXRPC when using the
java.util.Calendar object:

To be supported by JAX-RPC, an application class must conform to the
following rules:

    * It must have a public default constructor.
    * It must not implement (either directly or indirectly) the
java.rmi.Remote interface.
    * Its fields must be supported JAX-RPC types.

The class may contain public, private, or protected fields. For its
value to be passed (or returned) during a remote call, a field must meet
these requirements:

    * A public field cannot be final or transient.
    * A non-public field must have corresponding getter and setter

If I force my parameter to be a java.util.Date in my service interface I
will get an error in wsdeploy saying that it cannot cast java.util.Date
to java.util.Calendar! I'm thinking in editing the generated sources (tie) to
get a date instead the calendar itself but I don't know if it will work
(well I will try if I can do it).

What is the problem here or how can I solve it?

Pedro Salazar.