Setting the date format of web services

One Star

Setting the date format of web services

Hi there,
I have created a small web service which runs on Talend ESB and which has a date field in both the request and the response. For some reason, it only consumes dates of format DD-MM-YYYY out of the box even though the W3C Standard is YYYY-MM-DD (if I remember correctly). Where can I set the format for dates in my requests and responses?
Thanks
Matt
One Star

Re: Setting the date format of web services

kleinmat,
You mean on WSDL level?
One Star

Re: Setting the date format of web services

I am not aware of the possibility to set date formats on WSDL level. I mean on Talend component level.
One Star

Re: Setting the date format of web services

kleinmat,
You can set a pattern in the XSD of your WSDL.
<xs:simpleType name="FormattedDateType">
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}(0|1)(0||3)"/>
</xs:restriction>
</xs:simpleType>

And what in what component do you want to try the conversion?
One Star

Re: Setting the date format of web services

Thank you very much.
But in our WSDL, we have not set a specific time format. So our assumption was that our Web Service simply uses the W3C standard "YYYY-MM-DD".
But for some reason, if we send a request into the service, we have to use "DD-MM-YYYY" - otherwise we get an exception.
And when the Service generates a response, it sends the date therein in format "DD-MM-YYYY" also.
So I would like to tell the entire service (or the Service Request and Service Response component as well as any tXMLMap-component that has to handle dates) to use the W3C standard date format.
But how can that be set?
Why do the Talend components not use the W3C standard by default?
Thanks
Matt
One Star

Re: Setting the date format of web services

Just wanted to let you know that I created a bug report on this issue. Because I tested it with a fresh test project (all with default settings) and it behaved like that again.
And since a standard "out of the box" web service should always abide by the format definition of the W3C by default, I consider this problem a bug.
Here's the bug report in case you want to comment:
https://jira.talendforge.org/browse/TESB-14238