camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: doCatch returns null
Date Sun, 18 Nov 2012 12:31:45 GMT
Maxence,

I suggest that you try first with a simple camel CXF route

from("cxf:/myWebService?serviceClass=com.x.MyWebService")
.transform(new Output())
.log("Display output : " + new Output());

Remarks :
- What do you return from new Output ?
- CXF dataformat is by default POJO. That means that new Output should
return the objects that JAXB classes (generated by CXF plugin) will use to
send SOAP response to the HTTP client
- Transform processor allows to set the Out response used by camel exchange

Regards,

Charles


On Sun, Nov 18, 2012 at 12:41 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Hi
>
>
> In your code there may be a bug in doCatch I am not sure. Though can
> you try adding a extra step after the process in the doCatch.
>
>
> doCatch(...)
>    .process( ...)
>    .to("log:foo")   <-- add extra step
> .end()
>
>
> Also see this FAQ about using getOut or getIn
> http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
>
>
> On Fri, Nov 16, 2012 at 11:25 AM, maxence.dewil <the.maxxxx@gmail.com>
> wrote:
> > Hi,
> >
> > tested with camel 2.10.1 and 2.10.2 :
> >
> > *When I turn the route :*
> >
> >
> from("cxf:/myWebService?serviceClass=com.x.MyWebService").routeId("MyRoute")
> > .process(new Processor() {
> >     @Override
> >     public void process(Exchange exchange) throws Exception {
> >        exchange.getOut().setBody(new Output());
> >     }});
> >
> > *into :*
> >
> >
> from("cxf:/myWebService?serviceClass=com.x.MyWebService").routeId("MyRoute")
> > .doTry()
> >     .process(new Processor() {
> >         @Override
> >         public void process(Exchange exchange) throws Exception {
> >            throw new IllegalStateException();
> >         }});
> > .doCatch(IllegalStateException.class)
> >     .process(new Processor() {
> >         @Override
> >         public void process(Exchange exchange) throws Exception {
> >             exchange.getOut().setBody(new Output());
> >         }});
> > .end();
> >
> > *Then the response body of myWebService is empty.*
> >
> > Is it possible that my route returns something in a doCatch() ?
> >
> > Any help would be appreciated
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/doCatch-returns-null-tp5722851.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message