Skip to Content
Nov 26, 2018 at 01:20 PM

How to set Default value as " " for Date/Time fields using Mapwithdefault function.


In our target mapping XSD, we have a datetime field with minoccurs=1

<s:element minOccurs="1" maxOccurs="1" name="UPDATED_ON" nillable="true" type="s:dateTime"/>

When doing a message mapping to this field, if there is no data, the generated XML does not contain a tag for UPDATED_ON. This gives an error on the target side.

We need an empty tag when there is no data for this field. For example <UPDATED_ON><UPDATED_ON/> or </UPDATED_ON>

Please let me know if there is a way to achieve this.

I do not want to use MapWithDefault and pass a dummy datetime value to generate the tag as this would be passing incorrect data.