Quantcast
Viewing all articles
Browse latest Browse all 5648

How to pass multiple custom objects to processor

I have a wsdl with multiple operations and the typical structure of the
message looks like

<Envelope>
<Header>
<MyHeader>
....
.....
</MyHeader>
<Header>
<Body>
<MyBody>
.........
..........
</MyBody>
<Body>
<Envelope>

Can i unmarshal camel context and send MyHeader and MyBody objects to the
processor in properties or headers?
I do not want to write my custom type converters since there are multiple
"types" of MyBody (because there are multiple operations)

Currently, i have managed to make it work as following
public void myMethod(Exchange exchange,@XPath(//MyHeader) DOMNodeList
header, @Xpath(//MyBody mybody)
-- Do unmarshalling
-- Edit the message
-- Marshal
-- Set Body in outgoing exhange

Is this the right way to do it?

Viewing all articles
Browse latest Browse all 5648

Trending Articles