Error passing in a date object
I'm calling Oracle CRM On Demand by generating a WS proxy of its WSDL file. There's a field of date datatype in CRMOD and in the java class, it accepts a Calendar object. Below is my code
Here's my code
1) I have a Date object
2) I found a piece of code on the internet to get the WS 2.0 ISO8601 DateTime format. This method will format my Date object and return a String as below
String dateString = "2011-09-08T00:00:00-0700-07:00";
3)
SimpleDateFormat dfISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Date dt= dfISO8601.parse(dateString);
4)
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
5) customObject.setDStartDate(cal);
but it kept saying
"The value '11-09-08-07:00' cannot be converted to a date time value.(SBL-DAT-00359)"
It looks like Calendar reverts back to the default date formatting which does not conform to XSD format.
Do you have any idea?
Thanks