Thanks Claus it works, Another issue is I have an issue with the output of CXF Web service :
2011-11-05 14:20:31,562 [ult-workqueue-1] INFO outputfromWS - Exchange[ExchangePattern:InOut, BodyType:org.apache.cxf.message.MessageContentsList, Body:[Body is null]] From the above log the body appears to be Null but in real the body isn't null , How can I show the body class in the log ...note when I tried to use COnvertBodyto it works fine for sure I mean thru TisException or CommandResponse , the issue I want to filter this based in the class as below but body appears null as per the above log . CommandResponse or TisException are both classes I'm converting to them and I need to filter base on them but the issue body is Null . How we can make the body to by identified by the class name not null like below in order to filter it: 2011-11-05 14:20:31,562 [ult-workqueue-1] INFO outputfromWS - Exchange[ExchangePattern:InOut, BodyType:org.apache.cxf.message.MessageContentsList, Body:[Body is com.nsn.ossbss.charge_once.wsdl.entity.tis.xsd._1.CommandResponseData@72aebc]] or TisExcpetion class. Is it an issue with the web service or with the CXF version or camel itself? Thanks, Omar Atia -----Original Message----- From: Claus Ibsen [mailto:[email protected]] Sent: Saturday, November 05, 2011 1:31 PM To: [email protected]; Omar Atia Subject: Re: How to filter ? 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/
