On Sat, Nov 5, 2011 at 12:04 PM, Omar Atia <[email protected]> wrote:
> Dears,
>
> I need to know how to filter based on the body type of the exchange as body 
> type is class defined in my class path ...
>
> For example I have two body types , commandresponse.class and 
> tisexception.class , I need to differentiate between them to unmarshal them 
> using jaxb and convert the body to string ...
>
> For example :
>
> In case of body type = commandresponse I need to marshal it with jaxb class 
> commandresponse and in case of tisexception I need to  marshal it with 
> Faultmessage class ...
>
> The command response and tisexception are the output of cxf web service POJO 
> dataformat .
>

Are you use Java or XML to define the Camel routes?

filter()
  .when(body().isInstanceOf(MyClass.class)).to("xxx")

In XML you can use the simple language to test
http://camel.apache.org/simple

<filter>
  <simple>${body} is MyClass</simple>
  <to uri=....>
</filter>

You can also use the simple language in Java

filter()
  .when().simple("${body} is MyClass").to("xxx")


> Thanks,
> Omar atia
> Sent via BlackBerryŽ from mtc touch



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to