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: sun.net.www.protocol.http.HttpURLConnection.HttpInputStream, Body: [Body is instance of java.io.InputStream]]

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

Moderator

Re: cCXF response handling

Hello,

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

Sabrina

 

--
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.
Eight 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.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read