* 1) This requires the message to be fully loaded breaking the streaming
* 2) For large messages, the result can be a VERY large String and require
* large amounts of memory.
*/
public String toString() {
XmlConverter converter = new XmlConverter();
StringBuilder buf = new StringBuilder();
buf.append(getClass().getName());
buf.append(" headers: " + headers);
// go through the list of element and turn it into String
if (body == null) {
buf.append("body: " + body);
} else {
buf.append("body: [ ");
for (Element src : getBody()) {
String elementString = "";
try {
elementString = converter.toString(src, null);
} catch (TransformerException e) {
elementString = src.toString();
}
buf.append("[" + elementString + "]");
}