Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Mangled headers on CXFRS request

$
0
0
I am using Camel version 2.11.1, and CXF version 2.7.8.

I am trying to use the cxfrs component to submit a request to a rest service
from camel. I am invoking the route that makes the cxfrs call via a proxy
and have a processor that sets up the headers - bi is the BeanInvocation
object from the proxy - token is a string. Here is the processor:

exchange.setPattern(ExchangePattern.InOut);
exchange.getIn().setBody(null);
exchange.getIn().getHeaders().clear();
exchange.getIn().setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API,
Boolean.FALSE);
exchange.getIn().setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS,
bi.getMethod().getReturnType());
exchange.getIn().setHeader(CxfConstants.OPERATION_NAME,
bi.getMethod().getName());
exchange.getIn().setHeader(HttpHeaders.AUTHORIZATION, token);
exchange.getIn().setHeader(Exchange.ACCEPT_CONTENT_TYPE,
"application/vnd.company.foo+json"");
exchange.getIn().setHeader(Exchange.CONTENT_TYPE,
"application/vnd.company.foo+json")
exchange.getIn().setBody(bi.getArgs());

When the request is received downstream, the authorization header is
missing, and the camelacceptcontenttype and contenttype headers' values are
changed from what I set to 'application/xml'.

Wondering if I'm doing something wrong, or if there is an issue with the
version of Camel and CXF I'm using.

Viewing all articles
Browse latest Browse all 5648

Trending Articles