You can create a java service to achieve this. The code is :
IDataCursor cursor = pipeline.getCursor();
String dateFormat = “MM/dd/yyyy”;
String dateString = null;
if(cursor.first(“dateString”))
{
dateString = (String)cursor.getValue();
}
else
{
throw new ServiceException(“Missing input ‘date’”);
}
if (cursor.first(“pattern”))
{
dateFormat = (String)cursor.getValue();
}
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
Date date;
try
{
date = sdf.parse(dateString);
IDataUtil.put(cursor, “date”, date);
}
catch (ParseException pe)
{
throw new ServiceException(“Date '” + dateString +
“’ cannot be parsed using the format '” + dateFormat + “'”);
}
finally
{
cursor.destroy();
}
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB