• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

java.util.Date as method parameter in Webservices

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic