cancel
Showing results for 
Search instead for 
Did you mean: 

Web service endpoints doe snot support java.sql.Date

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Former Member
0 Kudos

Thanks for the info. This means that the documentation available in the SAP manual is incorrect.

So I need to use a Time attribute that has to be used by a web service and a web dynpro model.

The web dynpro model uses the client proxy created using the web service.

When I create the client proxy the java.util.Date is converted into a java.util.Calendar which is not supported by web dynpro.

any ideas on what I should be using so that both the web service and the client proxy support it.

thanks a lot

Padmaja Ragavendra

0 Kudos

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

Answers (0)