cancel
Showing results for 
Search instead for 
Did you mean: 

java.sql.Date converts to java.util.GregorianCalendar in webservice

Former Member
0 Kudos

Hi All

I have created a session bean having a business method saveInfo. The method contains a parameter dtDoB of type java.sql.Date. On exposing the bean as webservice, the type gets converted to java.util.GregorianCalendar.

Cant it remain as java.sql.Date so that i can import the webservice as model in webdynpro and bind the context to an inputfield.

If the context is of type java.util.GregorianCalendar then i am not able to bind it with an inputfield in webdynpro.

Please help. Its urgent.

Points will be awarded.

Regards

Sonal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Try this:

In the Webdynpro, set the date field

<modelclassobject>.set<modelvariablename>( new Timestamp( wdContext.currentContextElement().getEffDate().getTime()));

EffDate is of type 'date' in WD context.

<modelvariablename> is of type java.sql.Date in the session bean webservice.

Hope it solves the issue.

Avinash.

Former Member
0 Kudos

Actually Avinash i wanted to bind the model attributes directly to inputfield.

The solution u have told is an alternative which i have alreday implemented.

Thanks for ur help..

Regards

Sonal