We invoke a backend call using JAX-RPC. I have generated the JAX-RPC client using RAD8.5 and with WSDL/XSD files provided by our backend. Our client application gives us a String date value formatted as yyyyMMdd (20130720). The backend application requires this value formatted as yyyy-MM-ddZ.
Using the JAX-RPC generated objects it requires a Calendar object for this input. So I create a Calendar object converted to UTC (code below) and pass it in. The resulting XML is missing the "Z" on the end of my date. 2013-07-20.
So my question is, using JAX-RPC how do I get it to include the "Z" on the end of my date to meet the requirement of my backend? Is there something I need to do to the Calendar object or anything I to my JAX-RPC implementation?
Code for calendar creation
String requestedDate = "20130720"; //This is a parameter in a method.
Calendar requestedDateCal = Calendar.getInstance();
int year = 0;
int month = 0;
int day = 0;
year = Integer.parseInt((String) requestedDate.substring(0, 4));
month = Integer.parseInt((String) requestedDate.substring(4, 6));
day = Integer.parseInt((String) requestedDate.substring(6, 8));
requestedDateCal = DateTimeUtils.convertToGMTCalendar(year, month, day, 0, 0, 0, 0);
Code For convertToGMTCalendar()
Calendar localCalendar = convertToLocalCalendar(year, month, date, hour, minute, second, utcOffset);
TimeZone gmtTimeZone = TimeZone.getTimeZone("UTC");
Calendar gmtCalendar = Calendar.getInstance(gmtTimeZone);
gmtCalendar.setTimeInMillis(localCalendar.getTimeInMillis());
return gmtCalendar;
Code for convertToLocalCalendar()
TimeZone aTimeZone =
TimeZone.getTimeZone(TimeZoneConversion.GMT.getTimeZoneString() + Integer.toString(utcOffset));
Calendar localCalendar = Calendar.getInstance();
localCalendar.clear();
localCalendar.setTimeZone(aTimeZone);
localCalendar.set(year, month - 1, date, hour, minute, second);
return localCalendar;