THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
protected void processInOut(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws Exception { SourceTransformer sourceTransformer = new SourceTransformer(); String inMessage = sourceTransformer.toString(in.getContent()); out.setContent(new StringSource("<hello>Hello World! Message [" + inMessage + "] contains [" + inMessage.getBytes().length + "] bytes</hello>.")); } |
Tip | ||
---|---|---|
| ||
NOTE: You may have problems running above code. In this case remove <? ... ?> string from inMessage. ServiceMix validates XML on every step. So simple concatenating of two xml message will not work. |
Adding this method will require the import of the following classes:
...