Sam,
What I was suggesting on that thread is the creation of a simple Java service that takes two string variables as input, a date and a pattern. The Java service would then convert the date string into a Date object based on the pattern. This can be done via the java.text.SimpleDateFormat class.
I’m not familiar with the WmTransformationServices package, but it sounds like webMethods may have already created this service for you. Anyway, if you decide not to use their package for whatever reason, you can try something similar to the code below:
IDataCursor cursor = null;
try
{
cursor = pipeline.getCursor();
String dateStr = IDataUtil.getString( cursor, "dateStr" );
String pattern = IDataUtil.getString( cursor, "pattern" );
SimpleDateFormat format = new SimpleDateFormat( pattern );
Date date = format.parse( dateStr );
IDataUtil.put( cursor, "date", date );
}
catch( Throwable t )
{
throw new ServiceException( t );
}
finally
{
if( cursor != null )
{
cursor.destroy();
}
}
This service would take 2 string variables as input (dateStr and pattern) and it would output an object variable (date). If you use this, be sure to import java.util.Date and java.text.SimpleDateFormat.
Also, be sure to analyze the other suggestions provided on that thread to see which one best fits your needs. There are other solutions that may be easier for you depending on what you’re most comfortable with.
#webMethods#Adapters-and-E-Standards#Integration-Server-and-ESB