On Jun 6, 2014, at 1:51 AM, Puneet Gupta <[email protected]> wrote:

> Hi Dennis,
> 
> Thanks for your quick response.
> 
> Source of data is of java.sql.Timestamp type and its same in both the
> cases. I understand that there is no time information in Object1 but is
> there any way to return that object with below format:
> 
> 2013-12-10T00:00:00*.000*+05:30
> 
> Note that I want milliseconds to be appended in response.

If you can change the return type to a Calendar object (convert from Timestamp 
to Calendar in your processing someplace), then you should be able to call the 
setMillis(0) on the calendar and it should get written out.  Otherwise, you 
would need to plugin your own serialization routines as Dennis pointed out.

That said, I would advocate fixing whatever is expecting the ".000” to be 
there.   That is definitely a bug on their side.

Dan


> 
> Cheers,
> Puneet.
> 
> 
> On Fri, Jun 6, 2014 at 10:41 AM, Dennis Sosnoski <[email protected]> wrote:
> 
>> This is actually the same format, it's just that the first one doesn't
>> have any time-within-day information. You're probably using a java.sql.Date
>> value as the source of the data in Object1, or at least initializing it
>> with only a date and no time value.
>> 
>>  - Dennis
>> 
>> Dennis M. Sosnoski
>> Java Web Services Consulting <http://www.sosnoski.com/consult.html>
>> CXF and Web Services Security Training <http://www.sosnoski.com/
>> training.html>
>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>> 
>> 
>> On 06/06/2014 04:47 PM, Puneet Gupta wrote:
>> 
>>> Hi All,
>>> 
>>> I have a Apache CXF service developed in CXF 2.7.12 and JDK1.7. I am
>>> calling a service which returns two calendar objects. In SOAP response I
>>> am
>>> getting these calendar objects in different formats.
>>> 
>>> EX:
>>> 
>>> Calendar Object1: 2013-12-10T00:00:00+05:30
>>> Calendar Object2: 2014-05-19T15:25:43.943+05:30
>>> 
>>> These objects in WSDL are having XML type as xsd:dateTime.
>>> 
>>> Can anyone suggest me how to return same format for calendar objects?
>>> I want to return Calendar object with "*2014-05-19T15:25:43.943+05:30*"
>>> 
>>> this format specifically and I want this to be accomplished at server
>>> side.
>>> 
>>> Cheers,
>>> Puneet.
>>> 
>>> 
>> 

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to