If the thing you are invoking writes to System.out and you need that data, you should be able to do something like the following (make sure you have a finally that sets things back):
//Redirect System.out
PrintStream oldOut = System.out;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PrintStream newOut = new PrintStream(bos);
try {
System.setOut(newOut);
// do the stuff that writes to System.out
// …
// Get the data writen to your print stream
String output = bos.toString();
}
finally {
System.setOut(oldOut);
}
#Integration-Server-and-ESB#webMethods-General#webMethods