// Create an exec context for the target profile....
ExecutionContext executionContext = smooks.createExecutionContext();
CharArrayWriter outputWriter = new CharArrayWriter();
// Configure the execution context to generate a report...
executionContext.setEventListener(new HtmlReportGenerator("target/report/report.html"));
// Filter the message to the outputWriter, using the execution context...
smooks.filterSource(executionContext, new StreamSource(new ByteArrayInputStream(message)), new StreamResult(outputWriter));
return outputWriter.toString();