How to use java.util.Date in Axis2
I'm using Axis2 1.5.2 to pass Dates between client/server.开发者_如何学Python But when using java.util.Date Axis2 throws this error:
date string can not be less than 19 characters.
Anyone knows a workaround or how to fix it?
Looks like a bug in Axis2. My guess is that the expectation of DateTime
is what is causing that error versus it is now Date
. It appears that some have been able to switch to a Calendar
type which cured their issue.
When inter-operating between a .NET client and an Axis2 WS, type differencing surfaced so we would opt for primitive types, in this instance we used a long to hold the milliseconds, then converted it to a .NET DateTime representation. You could always switch to using a long/milliseconds and bypass the type all together.
As far as I know Axis2
doesn't support java.util.Date
.
I had the same issue, but I was able to overcome this problem by using Calendar
class.
I am using Axis2 1.5.2 and it does support java.util.Date.
Basically you need to know in which format you need to send Date ? either yy-MM-dd or yy/MM/DD HH:SS etc....?
Depending on the format, you should use SimpleDateFormat
and parse your date.
精彩评论