Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.util.Date as method parameter in Webservices  RSS feed

 
vikram karne
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am stuck up with a problem for a long time now and i desperately need your help in solving this issue.it goes as below.

We are making our application webservice enabled. for this to happen we are exposing the methods in the various session beans as webservices.
We are using the server-config.wsdd file for WSDL generation and using Axis as the engine.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What exactly are you stuck with? Making an RPC-style WS call that takes a date as parameter? What do you have so far, and what's missing?

If you java.util.Calendar instead of Date, then it should map to xsd ateTime in the WSDL; that should make things easier.
 
vikram karne
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks man

I was not online so could not answer your question.
What you have pointed out is correct. But the problem is that a lot of business logic has been implemented using java.util.Date as the type instead of Calander in a lot of business methods.The Date type forms a part of method parameters in a lot of method definitions also. so changing the businesss logic does not look fesible at this time.

I need to find a work around for this issue. The format for the parameter in the generated WSDL is of type DateTime even if we are using java.util.Date. is this correct .Can you suggest a work around for this issue or a code that needs to be changed to do this in my Test Client.


Thanks & Reagrds
Vikram
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vikram karne:
so changing the businesss logic does not look fesible at this time.

How difficult would it be to write Adapters/Facades for the client and service interfaces that convert between java.util.Date and java.util.Calendar so that the web services interfaces only use java.util.Calendar?
 
vikram karne
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

Thanks a lot for replies and suggestions.

I think i found out a solution to my problem.
I decided to do the conversion from java.util.Date object Calander object in my Test Client itself. Thus pass the Calander object as a parameter to the method In Stub. After doing this my Client is woring just fine.

Thanks & Regards
Vikram K
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!