Skip to Content
author's profile photo Former Member
Former Member

Web service endpoints doe snot support java.sql.Date


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.

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


Padmaja Ragavendra

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on 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,


    Add a comment
    10|10000 characters needed characters exceeded

    • 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 😉,



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.