cCXF response handling

Six Stars

cCXF response handling

I am calling the service with cCXF component with "RAW" mode. The response  get is in the body and it looks like

Exchange[ExchangePattern: InOnly, BodyType:, Body: [Body is instance of]]

  How would I see the response of the service in the body and not what I currently get.


Re: cCXF response handling


In the MESSAGE mode - the passed message is a complete SOAP message. So you will receive a DOM document of a complete SOAP message into your route and to create a response, you need to create a complete SOAP envelope reposponse

In the PAYLOAD mode to create a response, you will have to create a DOM document the message body.

In the POJO mode you have to attach a library with classes for the web service (service class, request and response classes) and to create a response, you will have to pass a response object as a route output.

Have you already created a Processor implementation where you create the output?

Best regards



Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: cCXF response handling

I just connected "Convert to" component with String.class and now I see the service's response in the body.
Seven Stars

Re: cCXF response handling

Other solution, if you want to manage the response in java, headers etc :


String response = exchange.getIn().getBody(String.class);


Specifying String.class as parameter makes conversion.