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
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.
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 ]
posted 16 years ago
it's kinda late response but thank you all! Calvin