If I get you correctly, I think the best pattern that matches your need is
:

   1. split your messages by headers and bodies (by using XPath or the
   tokenizer with regex expression)
   2. then aggregate it in the object you want (a collection or whatever
   you want)
   3. then call a processor with your result

In my opinion, when I see your process, I have the feeling that you
reinvent the wheel and you did by hand what camel can do for you.


2014-07-28 20:05 GMT+02:00 Matt Sicker <boa...@gmail.com>:

> If you're using XPath, couldn't you convert to Source or Result? Both from
> javax.xml.transform.
>
>
> On 28 July 2014 04:18, vdhawan <vaibhav.10.dha...@gmail.com> wrote:
>
> > 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?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/How-to-pass-multiple-custom-objects-to-processor-tp5754502.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Matt Sicker <boa...@gmail.com>
>

Reply via email to