Skip to Content
author's profile photo
Former Member

Web service endpoints doe snot support java.sql.Date

Hi,

I have a java class that has a java.sql.Date attribute in it.

My web service is returning an array of these objects with java.sql.Date attribute.

When I try to create my web service definition file it says that the method cannot be exposed as java.sql.Date is not supported. In the SAP development manual it says it is supported.

http://help.sap.com/saphelp_nw04/helpdata/en/94/91d32be5b8f945a4122ac6119316df/content.htm

Please help and let me know how I can get the object with java.sql.Date to be exposed in a web service.

thanks

Padmaja Ragavendra

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Oct 06, 2005 at 07:27 PM

    Hi Padmaja,

    java.sql.Date can't really be supported by the Web Service infrastructure, because it has no default constructor (parameterless constructor).

    Each complex type needs not only to be serializable (including its inner members - except they are primitive types), but they also must have a default constructor, so that they can be constructed during unmashalling of the request/response, i.e. whenever a parameter is unmashalled in the request or a return value is unmashalled in the response, the default constructor of the complex type is called and then the getters/setters are called to fill in the members of the complex type.

    java.sql.Date does not have a default constructor, hence it can't be supported by the Web Service infrastructure.

    Best regards,

    Vedran

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Padmaja,

      we had to use Strings (also because of other reasons) for our dates (encoding the date in UTC).

      What about modifying the WD model in such a way, that you extract the date from the client proxy and put it into the WD model or a context (via a supply function) manually?

      Hope this has helped,

      reward points are always welcome 😉,

      Regards,

      Vedran