camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Castyn <>
Subject Custom Processor with XPath
Date Mon, 21 Nov 2011 21:21:49 GMT
I am attempting to convert a SOAP message from one message format to another,
and along the way calculating and aggregating data.  At any rate, I am
trying to create a custom processor to do this, within which I will have
xpath calls and such.

Currently I am running into an issue trying to convert the message into a
org.w3c.dom.Document format for me to use XPath against, and it seems that
when I try to 

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.w3c.dom.*;

public class HotelProcessor implements Processor {

	public void process(Exchange exchange) throws Exception {
		Document payload = exchange.getIn().getBody(Document.class);

                // XPath stuff to go here

                exchange.getIn().setBody(payload.toString());  // Just temp
for testing

The payload becomes empty as the next step in the route is a null message. 
Any idea what I am doing wrong, or is there a different way I would want to
do this all together?  When I use getBody with String.class instead
everything works fine, but I can't perform xpath on the payload if I do

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message