aspose file tools*
The moose likes Web Services and the fly likes Can't deserialize xsd:date attributes using Axis WSDL2Java classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can Watch "Can New topic
Author

Can't deserialize xsd:date attributes using Axis WSDL2Java classes

Rafal Mrozik
Greenhorn

Joined: Jan 24, 2008
Posts: 10
Hello

I am generating client classes from a WSDL with the Axis WSDL2Java tool.
Many of the attributes of the complexType objects described in the wsdl are xsd ate attributes. I can call some of the methods successfully, but when I call a method that returns an object that has an attribute which maps to an xsd ate attribute from the wsdl, the client fails with a deserialization error.

Axis version: 1.4
Java version: 1.4.2_08
server: WAS 5.1.1.11



The problem (I think) is with attribute type type="xsd ateTime"

There are two interesting thing:
1.
For data 2008-04-21T08:08:54.925Z I have no error
But for data 2008-05-22T01:00:00+01:00 or 2008-04-18T00:00:00.000+02:00 I have this error

2. If the data is the problem so why in stack trace is no org.apache.axis.encoding.ser.DateDeserializer

Thanks
rafal
Faraz Masood
Ranch Hand

Joined: May 03, 2002
Posts: 55
same had happened with me !!

the problem is WSDL2Java converts xsd : dateTime as Java calendar object , and if you are not receiving the complete dateTime stream then you will receive this error.

in my case i made a change in wsdl locally , by converting dateTime to date ( because I was sure that my data will always look like a date and not dateTime) and this worked for me .

you may want to try something similar
Rafal Mrozik
Greenhorn

Joined: Jan 24, 2008
Posts: 10
Hello Faraz Masood, thanks for Your replay.

Unfortunately I need date with time zone information, soo I can't changing wsdl locally
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't deserialize xsd:date attributes using Axis WSDL2Java classes