• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

argument type mismatch problem using java.util.Date

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm new to WebServices and I'm using axis and the WSDL2Java tool to generate java client for testing. I got this error when I try to pass an bean object that has a field using java.util.Date.

- Could not convert java.util.Date to bean field 'dobDate', type java.util.Calendar
- Exception:
java.lang.IllegalArgumentException: argument type mismatch

The WSDL works fot C# client, but not for the Java client. I tried using GregorianCalendar instead, and the problem in Java client went away, but it become a problem for the C# client because it couldn't get the date.
Can anybody help me on this? Thanks you so much!!
Calvin
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect you won't be able to get Java and C# to agree on a class to represent a datae.
Maybe you would be better off with integer year, month and day or something similar.
Bill
 
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kong,
The reason for this is probably when you install the webservice in the Axis the wsdl that gets generated, replaces the date Object with the Calander, I had a similar problem and all I did was that I replaced the date with Calendar.
it is strange though, because axis has both the Date and the Calendar serializers.
This can be probably be changed if you specify the typemapping or beanmapping for the date Object specifically in the deployment descriptor (WSDD).
try it.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by William Brogden:
I suspect you won't be able to get Java and C# to agree on a class to represent a datae.
Maybe you would be better off with integer year, month and day or something similar.
Bill


There should be standard classes in both languages, mapping to the standard xs:datetime web-service type, should there not?
[ March 25, 2004: Message edited by: Billybob Marshall ]
 
Calvin Kong
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's kinda late response but thank you all!
Calvin
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic