Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

cCXFRS: HTTP Response code

Hi,

 

How can we handle the HTTP Response Code in a webservice with cXFRS component (Mediation route) ?

 

Eric

Labels (2)
4 Replies
Loko
Creator II
Creator II

Hi Eric

I guess you can get it in the seeded Camel headers in the next component after your CXFRS.

I can't remember which one exactly but just use a Cprocessor to loop on exchange.getIn().getHeaders() and print their names/values

Anonymous
Not applicable
Author

Hi Loko,

 

Thanks for your answer.

 

But that doesn't answer my question. I will rephrase my question with an example:

I have a webservice (Server). I receive an incoming request, I process it in my route and for any reason consider there is something wrong. I want to send back an HTTP code 202. How can I do that ?

 

I tried to update HTTP_RESPONSE_CODE (See http://camel.apache.org/cxfrs.html). But it doesn't work...

 

Eric

Loko
Creator II
Creator II

OK, you're talking about CXF server and not client.

 

HTTP_RESPONSE_CODE is a good point but you also have to set Fault on :

exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 202);
exchange.getOut().setFault(true);
Anonymous
Not applicable
Author

Hi,

 

It doesn't work. Did you test this piece of code ?

 

Eric